I am supposed to append all the integer values from STDIN in python.
For example:
5
6
0
4
2
4
1
0
0
4
Suppose the below is the integers coming from stdin, how can append these values in a list?
My code:
result = []
try:
while raw_input():
a = raw_input()
result.append(int(a))
except EOFError:
pass
print result
Could anyone help me? Thank you
Result is only printing [6, 4, 4, 0, 4]
raw_inputtwice per loop