Q. Write the output of the following code with justification if the contents of the file ABC.txt are:
Welcome to Python Programming!
f = open("ABC.txt", "r",)
size = len (f.read ())
print (size)
data = f.read(5)
print(data)
Output :-
30
>>>
Explanation :-
size = len (f.read ()) give output 30 because ABC.txt contains 30 characters.
data = f.read(5) give no output because after size = len (f.read ()) statement the pointer go to last point of txt file.
where is the answer
ReplyDeleteor you cant do the question
Sorry for inconvenience. I have uploaded answer.
DeleteHoly sit...where is answer if you can't solve it don't give us hole by only post the questions
ReplyDeleteSorry for inconvenience. I have uploaded answer.
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )