Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

import time

balance = 0

while True:
userinput = input("press 1 to check balance\npress 2 to withdraw\npress 3 to
deposit\n")
if userinput == "3":
userinputdeposit = input("how much would you like to deposit? ")
if userinputdeposit.isdigit():
balance = userinputdeposit
print(f"Your new balance is ${balance}")

if userinput == "1":
print(f"Your balance is ${balance}")

if userinput == "2":
userinputwithdraw = input("how much would you like to withdraw? ")
if userinputwithdraw.isdigit():
print(f"proccesing your withdraw amounting - ${userinputwithdraw}")
x = int(userinputwithdraw)
y = int(balance)
balance = x-y
time.sleep(1)
print("withdrawal done.")
time.sleep(1)
print(f"Your new balance is ${balance}")

else:
print("put only numbers")

You might also like