1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Aleonysh [2.5K]
2 years ago
8

Python Better Password Prompt

Computers and Technology
1 answer:
faust18 [17]2 years ago
3 0

We use an indefinite while loop to keep the user entering the password. In the loop, we use if-else structure to check the password. If it is "abc123", the password is found and stop the loop using a break. Otherwise, the password is not correct. Note that since we do not use any break statement in the else part, the loop will continue asking for the input

Comments are used to explain each line of the code.

You may see the output in the attachment.

#set the SECRET

SECRET = "abc123"

#create a loop

while True:

   

   #ask the user to enter a password

   password = input("Enter password: ")

   

   #check if the password is equal to SECRET

   # if it is, state that password is correct and stop the loop using a break

   # otherwise, state that password is not correct

   if password == SECRET:

       print("You got it!")

       break

   else:

       print("Sorry, that did not match. Please try again.")

Here is another question related to the loops:

brainly.com/question/25694810

You might be interested in
Malcolm is part of a team developing a new smartphone app to track traffic patterns. Because team members are located throughout
Umnica [9.8K]

Answer:

Virtual team

Explanation:

A virtual team is also known as a remote team, where every member of the team is working from different geographic locations. Usually, the communication channel is through voice/video conferencing or email.

Each member of the team is given unique roles and these roles are delivered optimally within the specified time frame.

For instance, Malcolm does not meet with other members of the team, yet they are working on a project (a smartphone app to track traffic patterns). Following standards that would have applied if they were working at a specific location.

Thanks to Information and Communication Technology (ICT), virtual jobs are on the increase, providing jobs to a lot of people not minding their geographic location.

7 0
3 years ago
Amanda needs to create an informative print brochure for her local library’s fundraiser dinner. What critical detail must she ha
frozen [14]
Target audience for the brochure
4 0
3 years ago
Read 2 more answers
The layout gallery displays 10 slide layouts with a variety of placeholders to define text and content positioning and formattin
Papessa [141]
The above statement is FALSE.

The layout gallery displays 9 slide layouts NOT 10. 

These 9 layouts have various<span> placeholders to define text and content positioning and formatting.

</span>1 - Title slide
2 - Title and content
3 - Section Header
4 - Two content
5 - Comparison
6 - Title only
7 - Blank 
8 - Content with Caption
9 - Picture with Caption
8 0
3 years ago
Today when Dylan turned on his computer, he noticed that the monitor was very dim. He could still see the desktop icon and text.
Vadim26 [7]

Answer:

B. Monitor backlighting

Explanation:

The computer system is a machine that can digitally receive input, process the inputted data and display and save results. The computer system is a physical system driven by a software component.

The computer hardware components are classified as input unit or devices, output unit, memory and storage unit, and  processing unit. The screen is an output unit of the computer system, it displays the output or result of the processed data.

The power supply to the screen, in this context, is not faulty due to the other screen used in testing the supply and input connectors. The back light on the screen has failed and that is why the brightness can not be adjusted.

3 0
3 years ago
Different uses of quick access toolbar
zhannawk [14.2K]
“The Quick Access Toolbar provides access to frequently used commands, and the option to customize the toolbar with the commands that you use most often. By default, the New, Open, Save, Quick Print, Run, Cut, Copy, Paste, Undo, and Redo buttons appear on the Quick Access Toolbar” -Information Builders
5 0
3 years ago
Other questions:
  • To begin importing data from an excel spreadsheet, click on the ____ tab on the ribbon.
    11·1 answer
  • Kyra needs help planning what images and text to use in her web page what technique can help her
    5·2 answers
  • Which of the following best define grit
    13·1 answer
  • Lenovo's ThinkPad laptop computers is designed in the United States, the case, keyboard, and hard drive are made in Thailand; th
    14·1 answer
  • A line beginning with a # will be transmitted to the programmer’s social media feed.
    11·2 answers
  • Search..
    14·1 answer
  • Which family does Ms word 2007 belongs to?​
    6·2 answers
  • What is your impression on the subject fundamentals of database systems?​
    7·1 answer
  • write ms-dos command to list all the files and folders of EIGHT sub directory of C: drive in ascending order according to file n
    5·1 answer
  • After a group sets a project schedule, members should be prepared to
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!