##### open function default read mode
f = open("input.txt", "r")
print(f.read())
f.close()
#Another Way
f = open("input.txt")
print("\n",f.read(10))
print(f.read(10))
print(f.read(10))
f.close()
#Another Way
f = open("code.txt")
print("\n1st :: ", f.read(50))
print("2nd :: ", f.read(10))
print("3rd :: ",f.read(10))
f.close()
#Another Way
f = open("input.txt")
print("\n1st :: ", f.read())
print("2nd :: ", f.read())
print("3rd :: ", f.read())
f.close()
Comments
Post a Comment