Professional Documents
Culture Documents
Python Codes
Python Codes
balance=231
print(balance)
withdraw=int(input("Please enter desired amount to withdraw"))
if balance-withdraw<0:
print("you don't have sufdficient amount")
else:
if withdraw%20==0 and withdraw%10==0:
balance=balance-withdraw
print("new balance", balance)
else:
print("ony 10 and 20 notes")
Depending on the number entered for example if 4 was entered, the program outputs:
4 green bottles sitting on the wall
3 green bottles sitting on the wall
2 green bottles sitting on the wall
1 green bottles sitting on the wall
0 green bottles sitting on the wall