Q. How are following codes different from one another?

(a)
my_file = open('poem.txt', 'r')
my_file .read()

(b)
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.

5 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post