lab terminal
lab terminal
PROGRAM:
accounts = {}
account_number = len(accounts) + 1
return account_number
if account_number in accounts:
accounts[account_number]['balance'] += amount
return accounts[account_number]['balance']
else:
if account_number in accounts:
accounts[account_number]['balance'] -= amount
return accounts[account_number]['balance']
else:
else:
return "Error: Account not found."
def check_balance(account_number):
if account_number in accounts:
return accounts[account_number]['balance']
else:
def main():
while True:
print("\nOptions:")
print("5. Exit")
if choice == 1:
elif choice == 2:
if type(balance) == float:
else:
print(balance)
elif choice == 3:
if type(balance) == float:
else:
print(balance)
elif choice == 4:
balance = check_balance(account_number)
if type(balance) == float:
else:
print(balance)
elif choice == 5:
print("Exiting...")
break
else:
if __name__ == "__main__":
main()
OUTPUT:
Options:
1. Create an account
2. Deposit money
3. Withdraw money
4. Check balance
5. Exit
Options:
1. Create an account
2. Deposit money
3. Withdraw money
4. Check balance
5. Exit
Options:
1. Create an account
2. Deposit money
3. Withdraw money
4. Check balance
5. Exit
Options:
1. Create an account
2. Deposit money
3. Withdraw money
4. Check balance
5. Exit
1. Create an account
2. Deposit money
3. Withdraw money
4. Check balance
5. Exit
Options:
1. Create an account
2. Deposit money
3. Withdraw money
4. Check balance
5. Exit
Exiting...