Question: Write a python code to manage user passport. The code should use python class as follows: The class should have a list called past_passwords
Write a python code to manage user passport. The code should use python class as follows: The class should have a list called past_passwords that saves all of the user's past passwords. The last item saved in the list is the current password. Write a function called current_password that returns the current password Write a function called update_password that update the user's password. The function update_password should only change the password if the new password is different from all the user's past passwords. Write a function called is_correct that receives a string and returns a True or False depending on whether the string is equal to the current password or not. Crete an instance of the class and test it using different passwords - -
Step by Step Solution
3.44 Rating (157 Votes )
There are 3 Steps involved in it
class UserPassport def initself selfpastpasswords def currentpasswordself if selfpastpasswords retur... View full answer
Get step-by-step solutions from verified subject matter experts
