Open(), Read() & Readline() For Reading File

Code file as described in the video

#Code as discussed in the video
  f = open("harry.txt", "rt")
print(f.readlines())
# print(f.readline())
# print(f.readline())
# print(f.readline())
# content = f.read()
#
# for line in f:
#     print(line, end="")
# print(content)
# content = f.read(34455)
# print("1", content)
#
# content = f.read(34455)
# print("2", content)
f.close()


Comments(1)

ahmedraza at 2019-06-23 09:30:09 says
nice