Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from time import sleep
- balance = 2500
- withdrawal = {1: 1000, 2: 2000, 3: 5000, 4: 10000, 5: 20000}
- def dispense(amount: int):
- balance = 2500
- withdrawal = {1: 1000, 2: 2000, 3: 5000, 4: 10000, 5: 20000}
- if balance >= withdrawal[amount]:
- print(f"paying =N={withdrawal[amount]}")
- balance -= withdrawal[amount]
- else:
- print("insufficient funds")
- print("Welcome to GTBank!")
- sleep(3)
- response = int(input(
- "press 0 for cardless transactions\npress 1 for card transactions\n"))
- if response == 0:
- print("cardless transactions")
- elif response == 1:
- operation = int(input(
- "please select a transaction\n1: account balance\n2: cash withdrawal\n3: airtime topup\n"))
- if operation == 1:
- print(f"your account balance is =N={balance}")
- elif operation == 2:
- amount = int(input(
- "please select withdrawal amount\n1: =N=1000\n2: =N=2000\n3: =N=5000\n4: =N=10000\n5: =N=20000\n6: enter amount\n"))
- if amount == 1:
- dispense(amount)
- elif amount == 2:
- dispense(amount)
- elif amount == 3:
- dispense(amount)
- elif amount == 4:
- dispense(amount)
- elif amount == 5:
- dispense(amount)
- elif amount == 6:
- specific_amount = int(
- input("enter amount\namount should be a multiple of =N=1000\n"))
- if specific_amount % 1000:
- print("amount must be a multiple of =N=1000")
- elif specific_amount > 20000:
- print("amount must not be more than =N=20000")
- else:
- if balance >= specific_amount:
- print(f"paying =N={specific_amount}")
- balance -= specific_amount
- else:
- print("insufficient funds")
- else:
- print("invalid selection")
- elif operation == 3:
- airtime = int(input("enter recharge amount\n"))
- if airtime <= balance:
- print(f"recharged {airtime} naira")
- balance -= airtime
- else:
- print("insufficient funds")
- else:
- print("invalid selection")
- else:
- print("invalid selection")
- sleep(3)
- print("thank for banking with us")
Advertisement
Add Comment
Please, Sign In to add comment