I was looking on a web of Python the commands mentioned in title and their difference; however, I have not satisfied with a complete basic understanding of these commands.
Suppose my file has only the following content.
This is the first time I am posing a question on this site, I will appreciate if someone clarifies my doubts for learning the Python. I thank the StackOverflow for this platform.
In the commands read()
, readline()
and readlines()
, one difference is of course reading whole file, or a single line, or specified line.
But I didn't understand the use/necessity of bracket ()
in these commands. For example, what is the difference in readline()
and readline(7)
? If the argument 7 exceeds the number of lines in the file, what will be output?
On the web mentioned above, it is explained what the argument in read()
does; but it is not mentioned what the argument in readline()
or readlines()
does?