Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command = input ("Choose total or average ")
- if command != "average" and command != "total":
- print ("sorry I don't understand")
- else:
- NoN = input("How many numbers will we use? ")
- NoN = int(NoN)
- total = 0
- for number_count in range(NoN):
- no1 = input("Give me a number?")
- num1 = int(no1)
- total = total + num1
- if command == "total":
- total = total + num1
- tot = str(total)
- print ("The total is " + tot)
- elif command == "average":
- total = total + num1
- resultA = total / NoN
- print ( "The average is " + str(resultA))
- print ("ByeBye")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement