Using With Block To Open Python Files

Code file as described in the video

with open("harry.txt") as f:
    a = f.readlines()
    print(a)

# f = open("harry.txt", "rt")
#Question of the day - Yes or No and why?
# f.close()
  


Be the first person to comment!

Comments(0)