My solution


#1

my_file = open("output.txt" or "r") # instead of comma(,) we can use (or) also.
print my_file.read()

my_file.close()


#2

Not sure why you would need to? The r serves to designate the file as read only by the program. It's not a conditional, so there is no purpose in using or.


#3

Hi,
Yep, you are right, but i meant it gives the same result.

Thank you for replying.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.