- 1

Where did I go wrong

I followed this code on youtube and I get an error on line 34 from cardholder import cardholder def print_menu(): ### Print options to the user print("Please choose from one of the following options:") print("1. Deposit") print("2. Withdraw") print("3. Show Balance") print("4. Exit") def deposit(cardholder): try: deposit = float(input("How much $ would you like to deposit: ")) cardholder.set_balance(cardholder.get_balance() + deposit) print("Thank you for your Deposit. Your new balance is: ", str(cardholder.get_balance())) except: print("Invalid input") def withdraw(cardholder): try: withdraw = float(input("How much $ would you like to withdraw: ")) ### Check if user has enough money if(cardholder.get_balance() < withdraw): print("Insufficient Funds :") else: cardholder.set_balance(cardholder.get_balance() - withdraw) print("You're good to go! Thanks you :)") except: print("Invaild input") def check_balance(cardholder): print("Your current balande is: ", cardholder.get_balance()) if__name__ == "__main__": current_user = cardholder("","","","","") ### Create a repo of cardholders list_of_cardholders = [] list_of_cardholders.append(cardholder("45643198076287154", 1234, "John", "Bluffington", 205.22)) list_of_cardholders.append(cardholder("52162254589711356", 7821, "Bill", "hand", 505.32)) list_of_cardholders.append(cardholder("32356409806681125", 6642, "Mia", "Johnson", 1105.58)) list_of_cardholders.append(cardholder("11165687823341138", 4548, "Anika", "Tisdale", 4105.12)) list_of_cardholders.append(cardholder("75924165944301091", 1234, "Delbert", "Thompson", 95.08)) ### Prompt user for debit card number debitCardNum = "" while True: try: debitCardNum = input("Please enter your debit card: ") ### check against repo debitMatch = [holder for hol

15th Sep 2022, 10:36 PM
damon Hutchinson
damon Hutchinson - avatar
1 Réponse
+ 3
Hello Damon Idk if you noticed, but the snippet is truncated due to characters limit. Rather save the snippet as code bit and share its link in post Description, it's not gonna get truncated that way. Besides, line numbering isn't available with raw text snippet like that. https://www.sololearn.com/post/75089/?ref=app And please, use relevant words in post tags. Here tags serve a different purpose - not for mentioning people https://code.sololearn.com/W3uiji9X28C1/?ref=app
16th Sep 2022, 12:05 AM
Ipang