My solution


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



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.


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

Thank you for replying.


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