Write a program in Python that serves as a password checker. The string password that Python should check. for is, "wahtZ9t%". The program must limit the user to 3 password attempts. A loop controlled by the range function must be used to execute up to 3 times. If the user entered password matches the target then the computer should output a success message that includes the number of tries it took to get it right. Then the loop must exit. Otherwise display a failure message, including attempts left and return to top of loop. If the user fails all 3 attempts output a message that the users password has been revoked. Process: • Declare and set values for variables needed throughout the code o A string containing the "target" password: "wahtz9t%" o A limit for attempts at entering the password: 3 o A Boolean value to show if the user succeeded in entering the password (or not) • Create an iterative structure to execute up to 3 times: o Prompt the user for a password o If the entered password matches the "target": • Output a success message that includes the number of tries needed to get the password right Exit the loop ▪ o Otherwise: ▪ Output a failure message, including the number of attempts left Return to the top of the loop • If the user failed in three attempts to get the password: o Output a message that the user's password has been revoked
Write a program in Python that serves as a password checker. The string password that Python should check. for is, "wahtZ9t%". The program must limit the user to 3 password attempts. A loop controlled by the range function must be used to execute up to 3 times. If the user entered password matches the target then the computer should output a success message that includes the number of tries it took to get it right. Then the loop must exit. Otherwise display a failure message, including attempts left and return to top of loop. If the user fails all 3 attempts output a message that the users password has been revoked. Process: • Declare and set values for variables needed throughout the code o A string containing the "target" password: "wahtz9t%" o A limit for attempts at entering the password: 3 o A Boolean value to show if the user succeeded in entering the password (or not) • Create an iterative structure to execute up to 3 times: o Prompt the user for a password o If the entered password matches the "target": • Output a success message that includes the number of tries needed to get the password right Exit the loop ▪ o Otherwise: ▪ Output a failure message, including the number of attempts left Return to the top of the loop • If the user failed in three attempts to get the password: o Output a message that the user's password has been revoked
Chapter8: Arrays
Section: Chapter Questions
Problem 8PE
Related questions
Topic Video
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,