PYTHON | READ COMPLETE FILE | STUDENT RECORDS FROM BINARY FILE
#Option-1
myfile = open("marks.dat","r")
x = myfile.read()
print(x)
print("File reading completed successfully....")
#Option-2
myfile = open("marks.dat","r")
x = myfile.readlines()
for i in x:
print(i,end="")
print("File reading completed successfully....")
myfile = open("marks.dat","r")
x = myfile.read()
print(x)
print("File reading completed successfully....")
#Option-2
myfile = open("marks.dat","r")
x = myfile.readlines()
for i in x:
print(i,end="")
print("File reading completed successfully....")
No comments
Post your comments