Use the readline method to write your own myReadlines function in python
<p>Your function myReadlines should take an open ﬁle as a parameter and a number n, and return a list of n lines that were read, where each list item is a line.  For example: </p>

<blockquote>
  <p>You are great.<br>
  You are good.<br>
  You were there.<br>
  Its good to see you.  </p>
</blockquote>

<p>and the function is called with an argument 2, <code>myReadlines(ﬁle, 2)</code> the following list
is returned: <code>['You are great.', 'You are good.']</code> like that. If n >
the number of lines, process only the number of lines present in the ﬁle at the point
the function is called. For example if the function is called with argument 8, only the
lines actually in the ﬁle are being returned through a list.</p>

<p>Here is the code that I tried:  </p>

<pre><code>def myreadlines(file,n):
  readfile = open("readline.txt","r")
  linelist = readfile.readlines(n)

  lines = [n]
  for lines in linelist:
    if n == 1:
        print(linelist)
</code></pre>
