5, then -2, then 9, and then closes the input, so there are no more lines.
nums = []
try:
while True:
nums.append(int(input()))
except EOFError:
print(sum(nums), len(nums))
What does the program print?Log in to join the discussion.
Loading…