How to write a program that would keep taking inputs from the user until the sum of all the inputs reach 200,
The numbers permissible for the user input are: 10, 20 and 50. If any other number is entered, then the program should declare it as invalid. I've tried the following but it doesn't seem to work out: count = 0 total = 0 print("Enter the values of amounts collected") while True: new_number = input('> ') count = count + 1 total = total + int(new_number) if total==200 : print("You have successfully collected 200") break if total>200: print("Amount collected exceeds 200") break Sample input: > 10 > 50 > 50 > 50 > 10 > 20 > 10 Sample output: You have successfully collected 200 Sample input: > 190 ... Sample output: Invalid input Sample input: > 50 > 50 > 50 > 20 > 50 Sample output: Amount collected exceeds 200