title: Difference in read(), readline() and readlines() in Python
body: <p>I was looking on a <a href="https://docs.python.org/2/tutorial/inputoutput.html#methods-of-file-objects" rel="nofollow noreferrer">web</a> of Python the commands mentioned in title and their difference; however, I have not satisfied with a complete basic understanding of these commands.</p>
  <p>Suppose my file has <em>only</em> the following content.</p>
  <blockquote>
  <p><em><strong>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.</strong></em></p>
  </blockquote>
  <p>In the commands <code>read()</code>, <code>readline()</code> and <code>readlines()</code>, one difference is of course reading whole file, or a single line, or specified line.</p>
  <p>But I didn't understand the use/necessity of bracket <code>()</code> in these commands. For example, what is the difference in <em><code>readline()</code></em> and <em><code>readline(7)</code></em>? If the argument 7 exceeds the number of lines in the file, what will be output?</p>
  <hr />
  <p>On the web mentioned above, it is explained what the argument in <em><code>read()</code></em> does; but it is not mentioned what the argument in <em><code>readline()</code></em> or <em><code>readlines()</code></em> does?</p>