python Better Password Prompt
Write a program that uses a loop and a half to prompt a user for a password. You should prompt the user for the password. If they get it correct, break out of the loop. If they don’t get it correct, you should give them an error message and ask again.

Sample Run:

Enter password: 123123
Sorry, that did not match. Please try again.
Enter password: password
Sorry, that did not match. Please try again.
Enter password: CODEHS
Sorry, that did not match. Please try again.
Enter password: abc123
You got it!
Note: You need to set SECRET to abc123 to run the tests

Answers

Answer 1

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:

https://brainly.com/question/25694810

Python Better Password PromptWrite A Program That Uses A Loop And A Half To Prompt A User For A Password.

Related Questions

Pls help me pls I’m struggling

Answers

Answer:Turn Right () Degrees (block)

The turn right () degrees block is a Motion block and a stack block. The block turns its sprite's direction the specified amount of degrees clockwise.

What is the interface of an app?
a storyboard software
the part the user sees
a sketch of your idea
a testing environment

Answers

Explanation:

An application interface or user interface ,is the set of features an application provides so that user may supply input to and recieve output from,the program.

_____ is the dynamic storage allocation algorithm that results in the largest leftover hole in memory.

Answers

Answer: Worst fit

Explanation:

Please define processor​

Answers

Processor means to break down something.

This computer is used by touching your finger.
A Desktop
C. Mainframe
B. Laptop
D. Tablet​

Answers

Answer:

a tablet because it's controlled by the touch of a finger.

codes 7.2.8: Listed Greeting python
pls help i have no idea on how to fix this

Answers

The listed greetings program is an illustration of Python functions.

The error in the program is that the program is not properly indented.

Python program uses indents to identify blocks of code.

So, the fix to the program is to properly indent the code, and the fix (without the comments) is as follows:

def greetings(s):

   x = s.split()

   print("Hello, "+x[0]+"! I also enjoy "+x[1]+"!")

Read more about Python programs at:

https://brainly.com/question/16240699

what is the term for delivering an application over the internet called?

Answers

Answer:

Cloud computing

Explanation:

The termnology which is used to describe the delivering of an application over the internet is called SaaS.

What is SaaS?

SaaS is an acronym for Software as a Service and it can be defined as a type of cloud computing delivery model that typicaly involves developing and making licensed software applications available to end users on a subscription basis and over the Internet, especially by centrally hosting these software applications within the cloud or through a third-party (vendor).

This ultimately implies that, Software as a Service (SaaS) is a termnology which is used to describe the delivering of an application over the internet.

Read more on SaaS here: https://brainly.com/question/24852211

Find the error in the following code fragment. int a: System.out.print(a):​

Answers

Answer:

If your using java, then its supposed to be "System.out.print("a")"    

Explanation:

its supposed to have quotations

when demonstrating 2022 altima’s parking assistance, what steering feature should you mention when pointing out how easy the vehicle is to steer at low speeds?

Answers

Based on automobile technology, when demonstrating 2022 Altima's parking assistance, the steering feature one should mention when pointing how easy the vehicle is to steer at speed is "the Cruise Control w/Steering Wheel Controls."

What is Cruise Control w/Steering Wheel Controls?

The Cruise Control w/Steering Wheel Controls allow the driver or the user to adjust the car's speed to the present rate, either lower or higher.

The Cruise Control feature assists in providing additional time and distance between the car and another one in front when parking or highway.

Hence, in this case, it is concluded that the correct is "the Cruise Control w/Steering Wheel Controls."

Learn more about the same parking assistance in an automobile here: https://brainly.com/question/4447914

Which of the following would be the most appropriate way to define a method that calculates and returns the final price, after tax and tip, for a passed in price, assuming tip is always 15% and tax is always 8%?

a. public double getFinalPricel double tips, double tax).
b. public double getFinal Price double tax)
c. public double getFinalPrice/double basePrice, double tips)
d. public double getFinalPrice double basePrice, double tips, double tax)

Answers


D. I hope it helped

Discuss the ways you can perform to prevent your computer/device and its data/contents from being stolen. Define two-facto authentication.

Answers

Answer:

is a security that needs two types of identification to access what your trying to enter.

Explanation:

Ex= to enter email, you first need to put in password, then verify by phone call that u need to enter.

A numeric test score is to be converted to a letter grade of A, B, or C according to the following rules: A score greater than 90 is considered an A; a score between 80 and 90, inclusive, is considered a B; and any other score is considered a C. What code segments will assign the correct letter grade to grade based on the value of the variable score?

Answers

The code segment makes use of conditional statements.

Conditional statements in programming are used to make decisions

The code segment in C++ is as follows

if (score > 90) {

grade = 'A';

}

else if (score >= 80 && score < =90) {

grade = 'B';

}

else {

grade = 'C';

}

The above code segments take the score, make comparison, and then determine the appropriate letter grade.

Read more about code segments at:

https://brainly.com/question/20475581

II and III

Explanation:If it is the test i think it is

I is incorrect because it is saying that automatically it is set as C but if the score is over 90 then you get an A if it's anything else then it's a B. This is false because then your outcome will never be C. It would only be A or B.
II is correct because it starts off by saying that if the score is greater than 90 then you'll get an A if else then if your score is equal to or greater or equal to than 80 then you get B and then if anything else then it's a C. This incoorporates everything.
III is also true because it start off by saying if anything is below an 80 then you automatically get a C. If it's anything over than 80 then if it's equal to or less than 90 then you get a b and if it's anything else then you get an A. This also checks out which means it's true.
So the answer is II and III

Why is experience in their own factory setting
crucial for a manager in the manufacturing
business?

Answers

Answer:

How to Manage Manufacturing Operations Effectively

Ensure High-Quality Products. ...

Ensure High-Quality Equipment. ...

Know How To Maximize Resources. ...

Look Into Technological Advancements. ...

Check Your Customer Service. ...

Consider Reducing Waste. ...

Conclusion.

Explanation:

Which of the following is true regarding computer science careers?
A. There are a limited number of jobs in this field.
B. There are not different job types in this field.
C. The number will increase over the next several years.
D. You must be a programmer to work in this field.
(WILL MARK BRANLIEST IF CORRECT)

Answers

Answer: There are several different job types in this field.

Explanation: did the test and got it right

Answer:

A or C!

Explanation:

Im pretty sure its one of those answers. I think its C though! If I'm wrong, please tell me! I just did the test and I forgot if I got it right or not. It wont let me go back in-

- A FLVS student with a 99.91 percent in computer science (Totally not bragging!)

please help
Felicity wants to take her DSLR camera on vacation, but she can take only one bag. Why is taking a DSLR camera with her not a good idea?

Answers

The reason why taking a DSLR camera with her is not a good idea is because a DSLR camera and its accessories usually require their own bag and can be heavy.

A digital single-lens reflex (DSLR) camera is being used by photographers especially for shooting stunning landscapes or portrait images. DSLR cameras are durable and can be used with a variety of lenses and attachments, they have a long battery life, and provide faster shooting speeds with better autofocus.

Therefore, the reason why taking a DSLR camera with her is not a good idea is because a DSLR camera and its accessories usually require their own bag and can be heavy, whereas she can only take one bag with her.

Learn more about digital single-lens reflex (DSLR) camera here:

https://brainly.com/question/13972212

Answer:

I got the answer here:

Explanation:

____________________ are protocols used by routers to make path determination choices and to share those choices with other routers.

Answers

Answer: Routing protocols

Explanation:

How does a cell phone change the
incoming signals from a caller into sound that
you can hear

Answers

Answer:

they send electrical signals to the buzzer. The buzzer changes those electrical signals into sound. You hear the buzzer sound and know that someone is calling you.

Explanation:

Answer: Cell phone or any electric device you can say changes the electric signal to radio waves at transmitting end which is converted back to electric signal and perceived as sound waves at receiving end

Explanation:

which computer belongs to the first generation?​

Answers

ENIAC (Electronic Numerical Integrator and Calculator .)

Write a function float Average(int, int) that finds the mean, and then write a main program that inputs two numbers from the user repeatedly until the user enter “0”. You need to call the function and display the mean of two numbers in the main. C++ language only.

Answers

The program illustrates the use of functions.

Functions are used to group related code segments that act as one, when called.

The program in C++ where comments are used to explain each line is as follows:

#include <iostream>

using namespace std;

//This defines the Average function

float Average(int num1, int num2){

   //This returns the average of the numbers

   return (num1+num2)/2.0;

}

//The main method begins here

int main(){

   //This declares the numbers as integer

   int num1, num2;

   //This gets input for both numbers

   cin>>num1; cin>>num2;

   //This is repeated until the user enters 0

   while(num1!=0 || num2 !=0){

       //This calls the average function, and prints the average

       cout<<Average(num1,num2)<<'\n';

       //This gets input for both numbers, again

       cin>>num1; cin>>num2;

   }

   return 0;

}

Read more about similar programs at:

https://brainly.com/question/17378192

difference between boot disk and booting in 5 points​

Answers

[tex]Answer \: -[/tex]

In computing, booting is the process of starting a computer. It can be initiated by hardware such as a button press, or by a software command. After it is switched on, a computer's central processing unit (CPU) has no software in its main memory, so some process must load software into memory before it can be executed. This may be done by hardware or firmware in the CPU, or by a separate processor in the computer system.

A boot disk is a removable digital data storage medium from which a computer can load and run an operating system or utility program. The computer must have a built-in program which will load and execute a program from a boot disk meeting certain standards.

Brianna is taking a backpacking trip in the wilderness and wants to back up the photos from her camera. Which type of storage device would be best for this purpose?
A. Optical disc
B. Cell phone
C. Flash drive
D. HDD

Answers

Answer:

C

Explanation:

Flash drives usually have an input (E.G. one of those android charger connectors), so just plug that into your camera, and load the flash drive with the photos. Then go home and plug the USB on the flash drive into your PC. If there isn't already, a folder will be made in your "Pictures" folder on your PC, to which you can open the folder, and then your photos should be there. From there you can open them, print them, etc.

Hope this helped, and sorry if I didn't answer in time.

What software type is software that is distributed free of charge, but the source code is not available

Answers

Answer:

Closed Source software programs

Fill in the blank: Every database has its own formatting, which can cause the data to seem inconsistent. Data analysts use the _____ tool to create a clean and consistent visual appearance for their spreadsheets.

Answers

The tool used by data analysts to create a clean and consistent visual appearance for their spreadsheets is called clear formats.

A database refers to an organized or structured collection of data that is typically stored on a computer system and it can be accessed in various ways. Also, each database has a unique formatting and this may result in data inconsistency.

In Computer science, a clean data is essential in obtaining the following:

Data consistencyData integrityReliable solutions and decisions.

Furthermore, spreadsheets are designed and developed with all kinds of tools that can be used to produce a clean data that are consistent and reliable for analysis.

In this context, clear formats is a kind of tool that is used by data analysts to create a clean and consistent visual appearance for their spreadsheets.

Read more on database here: https://brainly.com/question/15334693

¿Qué juegos pueden jugarse en un Raspberry 4 B con 2 GB de RAM?

Answers

Answer:

flow chart of sales amount and commission %of sales


Pls help me pls I’m struggling

Answers

you have it correct

can’t be opened because apple cannot check it for malicious software.

Answers

Answer:

try to reset  your computer.

Explanation:

List three (3) features of first generation computer

Answers

Answer:

features are

the first generation computer were based on vacuum tube technology

they were very large in size,very slow in speed and very low in capacity

they used to get heat very soon

Main electronic component – vacuum tube.

Main memory – magnetic drums and magnetic tapes.

Programming language – machine language.

Power – consume a lot of electricity and generate a lot of heat.

A ____ is a rectangular object you can click; when you do, its appearance usually changes to look pressed.

Answers

Answer:

button

Explanation:

Which of these problems is correct if the numbers are binary numbers?
Group of answer choices

1 + 1 = 2

1 + 1 = 10

0 + 0 = 1

1 + 0 = 10

Answers

Answer:

1 + 1 = 10

Explanation:

2 does not occur in the binary "alphabet"

0 + 0 = 0 in any base, so also in binary

1 + 0 = 1 in any base, so also in binary

The answer is 1 + 1 = 10
1 = 1 in binary numbers, so 1 + 1 = 2 but 2 in binary numbers is 10, 2 doesn’t exist in binary numbers, it is only 1s and 0s so therefore it would be 10.

how does digital and hybrid computers differ in portability​

Answers

Answer:

Digital computers perform functions like mathimatical,compex calculations. while hybrid computers work with the duo combinations like analog and tempature.

Explanation:

I passed the class A+

yourwelcome :)

thank me if it was correct for you too.

Other Questions
what method is used most frequently to investigate the structure of sediment and rock layers of the sea floor What is the name of the piece above Give reason. When the tip of a plant is cut, it does not grow tall. please i need help asap A car starts with a velocity of 16 m/s and slows at a constant rate of -2m/s2, what is its velocity after 3 s? Write an inequality that represents the graph (01.04 MC)The elevation of city A is 80 feet below sea level; the elevation of city C is 16 feet below sea level. The elevation of city D is 1 over 2 of the elevation of city C. Part A: Write an expression to represent the elevation, in feet, of city D. (5 points) Part B: Solve the expression and explain why the answer is negative or positive. (5 points) What are some fundamental beliefs that would be on the Libertarian platform? can someone help me with this question Jamal bought a concert ticket online for $57. He used a coupon code to get a 40% discount. The website also applied a 20% processing fee to the price after the discount. How much was the processing fee? Round to the nearest cent. 17. Which does NOT show aesthetically pleasing environment? A. Always motivate learners to be ready and open to learning. B. Learners will feel happy to be in school. C. Inspire learners to actively participate in class. D. Gives them the feeling of security. How would you ask a friend, "Hows it going?" in spanish Explain why Diocletian was important to the development of the Byzantine empire Round off your answer to one decimal place. 25 added to the difference between Y and 7 Which of the following is NOT a way that carbon is released into the atmosphere? why must a ph meter be calibrated by using a solution with a known ph value why is aspirin recommended for someone having a heart attack? 40 POINTSWould the poster still be effective in wartime if one had never read In Flanders Fields? Explain your opinion and give evidence to support your ideas. (3-5 sentences) Monica says,"if 4 bottles cost $10, then 2 bottles cost $5 + $20." Is Monica correct? Explain6 grade shiiii, help me out doe, thanks luvs