Answered step by step
Verified Expert Solution
Question
1 Approved Answer
No wrong answer plz 1. Create a class BankAccount, the __init__(self, pin) method should initialize the balance as 0 and pin as pin. 2. Create
No wrong answer plz
1. Create a class BankAccount, the __init__(self, pin) method should initialize the balance as 0 and pin as pin. 2. Create method name deposit (self, pin, amount), which takes 2 arguments, pin and amount. Method should increment account balance by amount and return new balance. If user wants to deposit more than 3000$ it should ask for the pin again and deposit if its correct. 3. Create method name withdraw (self, pin, amount), which takes 2 arguments, pin and amount. Method should decrement the account balance by amount and return new balance. When user try to withdraw the amount more than the amount in the account then It should display the message Not sufficient balance. 4. Create method get_balance(self, pin), this method should return account balance. 5. Create method change_pin(self, old_pin, new_pin), should change the account pin. 6. If user try to enter the amount with the wrong pin program should display the "Wrong Pin error message. 7. Create two instances of the BankAccount and call all the methodsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started