Jan-08-2020, 06:24 PM
Im posting this in Homework as I am taking a self paced course.
Im on a Centos 6 vm.
There is both python 2.7.5 and 3.7 loaded.
I am not sure why I am getting the error given below.
Post preview shows that the alignment is incorrect.
The output = f.read() is lined up with the o in open
The print statement is lined up with the w in the with.
Thanks
Sum
Im on a Centos 6 vm.
There is both python 2.7.5 and 3.7 loaded.
I am not sure why I am getting the error given below.
Post preview shows that the alignment is incorrect.
The output = f.read() is lined up with the o in open
The print statement is lined up with the w in the with.
@localhost ~]$ python3.7 Python 3.7.4 (default, Jan 8 2020, 08:43:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> with open("shver.txt") as f: ... output = f.read() ... print(output) File "<stdin>", line 3 print(output) ^ SyntaxError: invalid syntax >>>Any help would be appreciated.
Thanks
Sum