Q. How are following codes different from one another?
(a)
my_file = open('poem.txt', 'r')
my_file .read()
my_file = open('poem.txt', 'r')
my_file .read()
(b)
my_File = open('poem.txt", 'r')
my_file .read(100)
my_File = open('poem.txt", 'r')
my_file .read(100)
Answer =
(a) Will read all data of 'poem.txt', While
(b) Read-only 100 bytes.
(b) Read-only 100 bytes.
Nice
ReplyDeleteThankyou : )
DeleteWelcome 😊😊
Deleteone quotation is missing in b)'s question part for mode
ReplyDeleteIT IS UPLOADED, Please check again.
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )