import sys
n = int(sys.stdin.readline())
for _ in range(n):
s = input()
print(s)
This is my code in Python3.3.
I encounter with an input problem.
If i enter my input by one by one first '3' and first string and second string and third string.
There is no problem. But when I copy all input data and paste it readline() function reads all data. I thought it reads until '\n',
But it is not working.
Here is the Error Message :
Traceback (most recent call last):
File "D:/Users/SUUSER/Desktop/a.py", line 3, in <module>
n = int(sys.stdin.readline())
ValueError: invalid literal for int() with base 10: '3\nasd\nfre\n345\n'
'3\nasd\nfre\n345\n'
It reads all data for (n)
But I just want to read 3.
How can i get it ?