Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The foloming progan asbs user to ingut a number finteger) and then abls the user to kool the value which fo two times of that

image text in transcribed
image text in transcribed
The foloming progan asbs user to ingut a number finteger) and then abls the user to kool the value which fo two times of that number. If the uper anwwers incorrectiv then it rrseatedy mas the sume question tix the use antwers with the correct twrs times value in the end it outbuts bew many stempis in took the user to miswer coerectly, The greginn is incoeviets and thy aluo have iome eroin. Compiete the proegan and correct the truer, if arr. stef maing 1 n - invutrotve a manbeni7 two,times.n =n+2 attempts =1 answer - input('What is two times of the number you gave?7 while? 1= print[Your answer is incorrect. Try again"7 print'"You answered it correctly in"; attempts, "attempt(s). Good bye!") The following program asks user to input a number finteger) and then asks the user to input the value which is two times of that number. If the user answers incorrectly then it repeatedly asks the same question till the use answers with the correct two times value. In the end it outputs how many attempts it took the user to answer correctly. The program is incomplete and may also have some errors. Complete the program and cotrect the errors, if any. def main(): n= input('Give a number: ") two times n=n+2 attempts =1 answer = input['What is two times of the number you gave? ") While print("Your answer is incorrect. Try again.") print("You answered it correctly in", attempts, "attempt(s). Good bye!" ) The foloming progan asbs user to ingut a number finteger) and then abls the user to kool the value which fo two times of that number. If the uper anwwers incorrectiv then it rrseatedy mas the sume question tix the use antwers with the correct twrs times value in the end it outbuts bew many stempis in took the user to miswer coerectly, The greginn is incoeviets and thy aluo have iome eroin. Compiete the proegan and correct the truer, if arr. stef maing 1 n - invutrotve a manbeni7 two,times.n =n+2 attempts =1 answer - input('What is two times of the number you gave?7 while? 1= print[Your answer is incorrect. Try again"7 print'"You answered it correctly in"; attempts, "attempt(s). Good bye!") The following program asks user to input a number finteger) and then asks the user to input the value which is two times of that number. If the user answers incorrectly then it repeatedly asks the same question till the use answers with the correct two times value. In the end it outputs how many attempts it took the user to answer correctly. The program is incomplete and may also have some errors. Complete the program and cotrect the errors, if any. def main(): n= input('Give a number: ") two times n=n+2 attempts =1 answer = input['What is two times of the number you gave? ") While print("Your answer is incorrect. Try again.") print("You answered it correctly in", attempts, "attempt(s). Good bye!" )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sql++ For Sql Users A Tutorial

Authors: Don Chamberlin

1st Edition

0692184503, 978-0692184509

Students also viewed these Databases questions

Question

Have I incorporated my research into my outline effectively?

Answered: 1 week ago