201 Python Programming Exercises Volume 2 by Learning Edcorner
Author: Learning, Edcorner [Learning, Edcorner] , Date: July 14, 2023
, Views: 242
f.read()
f.seek(0)
print(f.read())
116. Add the necessary code on line 5 (in between the parentheses of print()) in order to get the current position of the cursor inside test.txt and have the result printed out to the screen.
f = open("test.txt", "r")
f.read(5)
print()
Solution:
f = open("test.txt", "r")
f.read(5)
print(f.tell())
117. Add the necessary code on line 5 (in between the parentheses of print()) in order to get the current mode in which test.txt is open (read, write etc.) and have the result printed out to the screen.
f = open("test.txt", "r")
Copyright Disclaimer:
This site does not store any files on its server. We only index and link
to content provided by other sites. Please contact the content providers
to delete copyright contents if any and email us, we'll remove relevant
links or contents immediately.