Skip to content

Instantly share code, notes, and snippets.

@jklmli
jklmli / sum
Created May 17, 2011 02:02 — forked from anonymous/sum
#!/usr/bin/env python
print("type integers, each followed by Enter; or ^D or ^Z to finish")
total = 0
count = 0
while True:
try:
line = input()
if line:
number = int(line)