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

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

1 Expert Approved Answer
Step: 1 Unlock

class UserPassport def initself selfpastpasswords def currentpasswordself if selfpastpasswords retur... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!