Skip to content

Instantly share code, notes, and snippets.

@hronecviktor
Created September 30, 2013 13:14
Show Gist options
  • Save hronecviktor/6763634 to your computer and use it in GitHub Desktop.
Save hronecviktor/6763634 to your computer and use it in GitHub Desktop.
IODemo
__author__ = 'zamr666'
total = 0
asum = 0
while(True):
line=input("Enter whole number or enter to finish: \n")
if line:
try:
asum+=int(line)
total+=1
line= None
except ValueError as err:
print(err)
continue
else:
break
print("Total numbers: ",total," Sum: ",asum," Avg: ",asum/total)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment