title: How to modify sys.stdin.readline() to read all the input data at the same time?
body: <p>I am working on the assignment of Data Structure from Coursera - not asking for answer, but I do need to modify the code:</p>
  <pre><code>
  def main():
    nodes = int(sys.stdin.readline().strip())
    tree = []
    for i in range(nodes):
      tree.append(list(map(int, sys.stdin.readline().strip().split())))
    if IsBinarySearchTree(tree):
      print(&quot;CORRECT&quot;)
    else:
      print(&quot;INCORRECT&quot;)
  
  </code></pre>
  <p>so that instead of typing the input data line by line, I can make the program read all of them at the same time, for doing so can save me a lot of time while de-buging.</p>
  <pre><code>3
  1 1 2
  2 -1 -1
  3 -1 -1
  </code></pre>
  <p>How can I achieve that</p>