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

One of the best ways to code effective programs is to write so-called _______ programs, using the sequential, selection, or repetition logic structures.

Answers

One of the best ways to code effective programs is to write so-called structured programs, using the sequential, selection, or repetition logic structures.

Structured programs are program types that aim to improve the clarity of program codes to make them readable and reusable.

Structural codes such as the if/then/else for selection and while/for repetition are used to achieve these goals.

So, structured programs are used to write programs that follow the sequential, selection, and repetition logic structures.

Learn more about structured programs here:

https://brainly.com/question/25770844

power steering belts should be checked for all of the following EXCEPT

Answers

You did not list the options.

If you want to use the randint function, you need to include import random in your program.
A. True
B.False

Answers

Answer:

A. True

Explanation:

Because to use randint (which means random integer) you need to import random module.

Fill in the blank to complete the sentence.
Binary Digit 1 0 0 0 0 0 1 1
Decimal Equivalent of Place Value 128 ? 32 16 8 4 2 1
The missing place value is
.

Answers

Answer:

ANSWER:62

Explanation:i dont know just trust me

The base of every positional numeral system is ten, which is expressed as 10 in the decimal numeral system (also known as base-ten). It is the numeral system that modern cultures utilize the most frequently.

What Binary Digit Decimal Equivalent of Place Value?

In binary numbers, place values rise by a factor of 2, as opposed to decimal numbers, where place values rise by factors of ten. The symbol for a binary number is X2. Think about the binary number, 10112 as an example. The place value of the rightmost digit is 120, while the place value of the leftmost digit is 123.

Digits are used to fill in the spaces on the place value chart in the decimal system. Binary, on the other hand, is restricted to 0 and 1, therefore we can only utilize 0 or 1 with each location. In a binary place value chart, the binary number 1001 is positioned to the right.

Therefore, Decimal Equivalent of Place Value 128 64 32 16 8 4 2 1.

Learn more about Binary Digit here:

https://brainly.com/question/20849670

#SPJ2

Which of the following applies to a trademark?
o belongs to just one company or organization
O always shown on the outside of a garment
O a way for people to copy a pattern
0 a mark that represents a product's "sold"
status

Answers

Answer:

a

Explanation:

Answer:

belongs to just one company or organization

Explanation:

edge 2021

Which of the following is true regarding computer science careers? There are a limited number of jobs in this field. There are not different job types in this field. The number will increase over the next several years. You must be a programmer to work in this field.

Answers

Answer: There are several types of jobs in this field

Explanation: i did the test

The practice of applying technology to address difficult organizational issues is known as computer science. Thus, option D is correct.

What is the carrier in the computer science?

Computers and technology have been incorporated into almost every economic sector, industry, and even organization operating in the modern economy, which is why this field is so crucial.

Because it allows me to pursue my two interests in problem-solving and creating engaging experiences, computer science is my field of choice.

I can come up with problems that are unique to a user, create and brainstorm solutions, and then put those ideas into practice through coding.

Computer scientists build, develop, and improve supply chains, content algorithms, and even job application platforms. We are already living in the age of computer science.

As technology grows increasingly pervasive in our lives and the economy, computer science becomes more crucial.

Learn more about computer science here:

https://brainly.com/question/20837448

#SPJ2


HELP IMPORTANT!!

i need help with Java basics

Answers

Answer:

C

Explanation:

Strings should be concatenated with +.

write the feature of ms-dos ?​

Answers

Answer:

Here you go

Explanation:

Features of MS Word :

Home

This has options like font colour, font size, font style, alignment, bullets, line spacing, etc. All the basic elements which one may need to edit their document is available under the Home option.

Insert

Tables, shapes, images, charts, graphs, header, footer, page number, etc. can all be entered in the document. They are included in the “Insert” category.

Design

The template or the design in which you want your document to be created can be selected under the Design tab. Choosing an appropriate tab will enhance the appearance of your document.

Page Layout

Under the Page Layout tab comes options like margins, orientation, columns, lines, indentation, spacing, etc.  

References

This tab is the most useful for those who are creating a thesis or writing books or lengthy documents. Options like citation, footnote, table of contents, caption, bibliography, etc. can be found under this tab.

Review

Spell check, grammar, Thesaurus, word count, language, translation, comments, etc. can all be tracked under the review tab. This acts as an advantage for those who get their documents reviewed on MS Word.

Source: https://byjus.com/govt-exams/microsoft-word/

c) Put these stages into the correct order.
(i) Script (ii) aim
(iii) Outline

Answers

Answer:

Aim

Script

Outline

Yan po answer, wag nang echoss mwa mwa

Explain how analog computers are used to process data generated by ongoing physical process​

Answers

Hi hi :)

Analog computers store data in a continuous form of physical quantities and perform calculations with the help of measures.

Okay bye :)

URGENT!! thank you!!!!!

Answers

Answer:

Robots or automatons

Explanation:

Machines that can perform tasks historically performed by humans can improve productivity (they can work non-stop) and of course the environment is safer for workers (work is done by a machine instead) but there is job loss (people who used to do the machine's work are redundant).

This is an image of the ...........................Topology.

if answer Correct i will mark the first person brainly.​

Answers

Answer:

Mesh

Explanation:

Why should you pay your full credit card balance by the due date every month?​

Answers

Answer: to avoid late fees and interest

Explanation:

filters cannot perform what action on collected data?

Answers

Answer:

am at 50/50

Explanation:

filters cannot be perform to include shopping preferances.

solve each of the following a. 3x=27 ​

Answers

Answer:

3^(x)=27     x=3

Explanation:

3x3x3 27

:)

3ˣ = 27

Factorise 27.

27 = 9 × 3

27 = 3 × 3 × 3

27 = 3³

So,

3ˣ = 27

=》ˣ = ³

3³ = 27

_____

Hope it helps ⚜

hiiiiiiiiihwdawdfgthnythgrfergthyjuhgfd

Answers

Answer:

Your answer would be gas.

Explanation:

Steam is just water just evaporated.

no i will not marry u

8.3.7: Exclamat!on Po!nts
Write the function exclamation that takes a string and then returns the same string with every lowercase i replaced with an exclamation point. Your function should:

Convert the initial string to a list
Use a for loop to go through your list element by element
Whenever you see a lowercase i, replace it with an exclamation point in the list
Return the stringified version of the list when your for loop is finished
Here’s what an example run of your program might look like:

exclamation("I like music.")
# => I l!ke mus!c.

Answers

The function is an illustration of loops.

Loop instructions are used to repeat operations

The function in Python, where comments are used to explain each line is as follows:

#This defines the function

def exclamation(myStr):

   #This iterates through the string

   for i in range(len(myStr)):

       #This checks if the current character of the string is "i"

       if myStr[i] == "i":

           #If yes, this converts the string to a list

           s = list(myStr)

           #This replaces i with !

           s[i] = '!'

           #This gets the updated string

           myStr = "".join(s)

   #This returns the new string

   return myStr

       

Read more about similar programs at:

https://brainly.com/question/22444309

software ............. the hardware what to display on the user's screen​

Answers

A monitor? This displays on the users screen but I’m not sure if that’s what your asking good luck on finding the right answer.

mightier than the waves of the sea is his love for you

Answers

cool but kinda creepy ngl

what percentage of teen social media users report observing cyberbullying online?

Answers

Answer:

59%

Explanation:

59% of teen i think thats the answer

How does Python recognize a tuple? You use tuple when you create it, as in "myTuple = tuple(3, 5)". You use brackets around the data values. You use parentheses around the data values. You declare myTuple to be a tuple, as in "myTuple = new tuple"

Answers

Answer:

Python recognizes a tuple when you have parenthesis and a comma. You use brackets when you're creating a list.

You cannot declare a tuple in that format. It has to be:

myTuple = (__, __) or something of the like. There are many ways you can do it, just not the way that you have it.

Explanation:

Python class.

Answer: parantheses AND COMMAS

Explanation:

write a program to print even numbers from 1 to 20​

Answers

Answer:

If qbasic then

pls mark barinist

Answer:

print(“2 4 6 8 10 12 14 16 18 20”)

What happened to China and India after they modernized their workforces by providing more training and education?

A.
Their economies collapsed as they were unable to pay for their public services.

B.
They experienced civil wars between the haves and have-nots.

C.
People refused to take advantage of these programs due to anti-Western biases.

D.
Millions of people were lifted out of poverty.

Answers

The correct answer is D.

The condition for China and India after they modernized their workforces by providing more training and education is;

''Millions of people were lifted out of poverty.'' So, option D is true.

Given that;

China and India modernized their workforces by providing more training and education.

After modernizing their workforces by providing more training and education, both China and India experienced a significant improvement in their economies.

As a result, millions of people were lifted out of poverty.

This positive change was driven by increased job opportunities, higher productivity, and improved skills among the workforce.

Therefore, Option D is true.

To learn more about education visit:

https://brainly.com/question/19959157

#SPJ3

A PIN of four digits has 10,000 (or 104) combinations. This could theoretically be guessed by a computer in milliseconds. The most popular PIN numbers are 1111, 1234 and 0000 making up around 20% of PIN numbers. Anything beginning with 19XX is also very common, as is 2580. Why?

Answers

Answer:

19xx could be a birth year, easy to remember

2580 is easy to remember because on a keypad the numbers are aligned vertically.

Note that from the statement above, one can say that 19xx is common as it is linked with birth year and thus easy to recur and also 2580 is very easy to recur because on a keypad the numbers are soften matched vertically.

What is pin about?

Pin or digit code are often used in our debit cards, credit cards and in a lot of mobile phones for security purposes.

Note that Note that from the statement above, one can say that 19xx is common as it is linked with birth year and thus easy to recur and also 2580 is very easy to recur because on a keypad the numbers are said to be aligned vertically.

Learn more about digits code from

https://brainly.com/question/3118454

#SPJ9

What commands does SuperKarel know that regular Karel does not?

turnleft() and jump()

O

turnRight() and jump()

O

turnAround() and turnRight()

O

turnAround() and jump ()

Answers

Answer:

turnRight and turnaround

Explanation:

The regular karel does not know these commands

The command that SuperKarel know that regular Karel does not is turnAround() and turnRight(). The correct option is C.

What is Karel?

Richard E. Pattis created Karel, an educational object-oriented programming language, to help teach programming to his Stanford University students.

Through simple object-oriented commands, the student learns to program by instructing Karel, a robot, to move, pick up a beeper, place a beeper, and turn off.

KAREL was developed as an educational tool to teach programming language elements to students studying robotics.

KAREL has since evolved into the primary FANUC programming language for robots and robot controllers. This powerful CNC programming language is extremely versatile.

SuperKarel understands two commands that regular Karel does not: turnAround() and turnRight ().

Thus, the correct option is C.

For more details regarding KAREL, visit:

https://brainly.com/question/13278951

#SPJ5

URGENTT 2 SIMPLE EASY QUESTIONS PLZZ HELP ION UNDERSTAND COMPUTERR ILL GIVE U BRAINLEST

Answers

Answer:

I'll happy to help

Explanation:

Please make your clear. I couldn't understand!

Please clear your question I can’t understand

Please define processor​

Answers

Processor means to break down something.

NO links!!! please, In this task, you will prepare the necessary documents required to apply for the job. Conduct research and find out what documents are necessary, such as a résumé, cover letter, and so on. Then, prepare these documents using your information and tailor the documents to the career you have chosen.
the job I chose was a software architect
It's from PLATO

Answers

To apply for a job, you must provide a resume, cover letter, reference list, letters of recommendation, portfolio, and employment certificate.

About these documents we can inform you that:

The Resume presents the most generalized information about the candidate's educational and professional background.The cover letter must be made to show more in-depth information, where the candidate reinforces their most positive points and relevant to the job vacancy.The reference list presents the opinion of other professionals about your professional abilities.The portfolio must be submitted by candidates related to artistic or visual areas and presents the works already created by that professional.The employment certificate must show your professional history in more detail.

Thus, we can state that the application for a job vacancy requires that many documents and information be provided.

More information on writing a resume at the link:

https://brainly.com/question/862477

what is a copy of a theme with different color schemes called?

Answers

Answer:

A copy of a theme with different color schemes is called a Variant

Explanation:

Aliaa and Zhang Li are tennis-playing robots. Aliaa is 715\,\text{cm}715cm715, start text, c, m, end text from Zhang Li and 2{,}200\,\text{cm}2,200cm2, comma, 200, start text, c, m, end text from the far corner. Zhang Li measures an 91\degree91°91, degree angle between Aliaa and the far corner, as shown.


From Aliaa's viewpoint, what is the angle between Zhang Li and the far corner?

Do not round during your calculations. Round your final answer to the nearest degree.

Answers

Answer:

70

Explanation:

Law of Sines.

sin(91)/12 = sin(x)/715

x=19

180-91-19=70

Other Questions
How do different activities, such as running or swimming affect your breathing? How does sleeping affect your breathing? you are going to wash a large glass window in a shape of a trapezoid. The lenghts of the bases of the window are 10 feet and 14 feet. the height is 8 feet. you can wash 6 square feet of the window in 1 minute. how long will it take you to wash the entire window Need help with this question brainliest for correct answer a) Staples Corporation shows a credit balance of $21,500 in Allowance for Doubtful Accounts at December 31, 2017, before the current year's provision for uncollectible accounts. The accounts receivable aging schedule revealed the following: Not yet due130 days past due 3160 days past due 6190 days past due Over 90 days past dueEstimated Percentage Uncollectible$250,000 3% 660,000 6% 125,000 12%85,000 28% 25,000 42%Compute the total uncollectible and journalize the entry on December 31, 2019, to record bad debts expense. how many times were the electrons of the constituent assembly held in Nepal mentioned your full date? Match these items .1 . scalespistil and stamen2 . eggcone parts3 . mitosisfungi parts4 . hyphaeleaf and spore case5 . moldvegetative reproduction6 . flower partscell division7 . cherry treemale cell8 . spermfemale cell9 . without seedsflowering plant10 . fern partsfungi E varies directly with G. When G is 6, E is 10. Find the value of G when E is 18 What does mounting mean?A) Calling B) FallingC) Rising 88, 89, 86, 90, 83, 81, 89What is the median number A 88B. 89C 90D. 86Please answer this I really need help NEED HELP ASAP!! Please no links!! How are these sculptures of the same subject portrayed differently? A sculpture of David by Bernini. David is clothed and leaning to the side. A sculpture of David by Michelangelo. David is naked and looks lost in thought. What percentage of 50 is 12? What is the purpose of the underlined part of the sentence?Because of the restoration of the forests of northern New England, wild turkey populations have made an amazing comeback over the past half century. What number must each side of the equation 3/5x= 12 be multipled by to produce the equivalent equation x = 20? please help need answer. Choose one plant which sexually reproduces. Compare and contrastcharacteristics of the plant with a variation of the same plant. What is the price at which equilibrium is achieved? $8 $9 $10 $30. Which one is it True or false? Horizontal Analysis of Income Statement For 20Y2, McDade Company reported a decline in net income. At the end of the year, T. Burrows, the president, is presented with the following condensed comparative income statement: McDade Company Comparative Income Statement For the Years Ended December 31, 20Y2 and 20Y1 20Y2 20Y1 Sales $ 16,800,000 $ 15,000,000 Cost of goods sold (11,500,000) (10,000,000) Gross profit $ 5,300,000 $ 5,000,000 Selling expenses $ (1,770,000) $ (1,500,000) Administrative expenses (1,220,000) (1,000,000) Total operating expenses $ (2,990,000) $ (2,500,000) Operating income $ 2,310,000 $ 2,500,000 Other revenue 256,950 225,000 Income before income tax expense $ 2,566,950 $ 2,725,000 Income tax expense (1,413,000) (1,500,000) Net income $ 1,153,950 $ 1,225,0001. Prepare a comparative income statement with horizontal analysis for the two-year period, using 20Y1 as the base year. Use the minus sign to indicate an amount or percent decrease. If required, round percentages to one decimal place.2. To the extent the data permit, comment on the significant relationships revealed by the horizontal analysis prepared in (1). some americans believe that americas human rights and humanitarian policies serve american interests by winning friends and demonstrating our concern for the oppressed and less fortunate. they believe that human rights and humanitarian policies are a form of what?