Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_number():
- while True:
- try:
- return float(input("Give me a number: "))
- except ValueError:
- print("Don't be silly, that's not a number!")
- def add():
- num = 0
- sum1 = 0
- ccount = 0
- count = int(input("How many numbers do you wish to add? "))
- while ccount < count:
- num = get_number()
- sum1 = sum1 + num
- ccount = ccount + 1
- print(sum1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement