Jan-22-2021, 04:32 PM
(This post was last modified: Jan-22-2021, 04:32 PM by beginner721.)
Hello everyone.. I have a problem
I have two Same Code but One of them Doesnt Work
This is the one that doesnt work
but this code is working even though both are same
Please help me ......
I've been working for hours for this.
I have two Same Code but One of them Doesnt Work
This is the one that doesnt work
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
balance = 1000 ## 1= BALANCE CHECK ## 2= deposit money ## 3= withdraw money ## q= exit while True : operation = input ( "Choose Operation:" ) if (operation = = "q" ): print ( "signing out..." ) break elif (operation = = "1" ): print ( "current balance: " ,balance) elif (operation = = "2" ): money = int ( input ( "amount deposited: " )) balance + = money print ( "current balance: " ,balance) elif (operation = = "3" ): money = int ( input ( "the amount you want to withdraw: " ) if (balance - money< 0 ): print ( "You dont have enough money" ) continue balance - = money else : print ( "Invalid operation, (choose 1,2 or 3" ) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
balance = 1000 ## 1= BALANCE CHECK ## 2= deposit money ## 3= withdraw money ## q= exit while True : operation = input ( "Choose Operation:" ) if (operation = = "q" ): print ( "signing out..." ) break elif (operation = = "1" ): print ( "current balance: " , balance) elif (operation = = "2" ): money = int ( input ( "amount deposited:" )) balance + = money print ( "current balance: " , balance) elif (operation = = "3" ): money = int ( input ( "the amount you want to withdraw:" )) if (balance - money < 0 ): print ( "You dont have enough money" ) continue balance - = money else : print ( "Invalid operation, (choose 1,2 or 3" ) |

I've been working for hours for this.