USING PYTHON Problem 1: Write a program that will calculate the problem and stop
ID: 3198137 • Letter: U
Question
USING PYTHON Problem 1: Write a program that will calculate the problem and stop after the condition has been met.a=number of loops (start with zero but will increase by 1 after each completed loop)
b=a+1
c=a+b
Condition: If c is less than 5, then the loop will continue; else, it will end.
3. Print a string variable that states the number of loops required to meet the condition for Problem 1. USING PYTHON Problem 1: Write a program that will calculate the problem and stop after the condition has been met.
a=number of loops (start with zero but will increase by 1 after each completed loop)
b=a+1
c=a+b
Condition: If c is less than 5, then the loop will continue; else, it will end.
3. Print a string variable that states the number of loops required to meet the condition for Problem 1. Problem 1: Write a program that will calculate the problem and stop after the condition has been met.
a=number of loops (start with zero but will increase by 1 after each completed loop)
b=a+1
c=a+b
Condition: If c is less than 5, then the loop will continue; else, it will end.
3. Print a string variable that states the number of loops required to meet the condition for Problem 1. Problem 1: Write a program that will calculate the problem and stop after the condition has been met.
a=number of loops (start with zero but will increase by 1 after each completed loop)
b=a+1
c=a+b
Condition: If c is less than 5, then the loop will continue; else, it will end.
3. Print a string variable that states the number of loops required to meet the condition for Problem 1.
Explanation / Answer
c=0
a=0
b=0
count=0
while c<5: # Will continue if c is less than 5
b=a+1
c=a+b
a=a+1 #increase 1
count=count+1
print("Nubber of loop required :- ",count)
Output:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.