lexyhallzie
lexyhallzie lexyhallzie
  • 14-01-2021
  • Computers and Technology
contestada

What is the output for the following program?

numA = 10
while numA < 21:
numA = numA + 5
print(numA)

Respuesta :

sidrakhudadad
sidrakhudadad sidrakhudadad
  • 14-01-2021

Answer:

Output:

15

20

25

Explanation:

In first iteration value of num is 10. Condition is checked 10 is less than 21 so value of num is incremented by 5 and value 15 is printed than again condition is checked 15<21 so value of num is incremented again and 20 is printed. Again condition is checked 20<21. So 25 is printed. Then 4th time when condition is checked vakue of num is 25 and while loop condition becomes false because 25 is not less than 21 and program is terminated here.

Answer Link

Otras preguntas

You are selling lemonade for $1.50, a bag of kettle for for $3, and a hot dog for $2.50 at a fair. Write and simplify an expression for the amount of money you
True or False A)Elasticity of demand measures the ratio of percentage change in quantity demanded to percentage change in income. B)Sales of the common necessi
Why do scientists seek to discover new laws of the universe?
In order to determine how many miles it is from a particular city on a map to the southern boundary of the United States, which map features would a student hav
if the area of a park is is exactly halfway between 2.4 and 2.5 acres, what is the area of the park?
20 percent of $35.00
Does it matter which way you subtract the values when finding distance
different ways to write 734
Where is a place where two geologic units meet
2x+6=6-3(x-1) solve the equation using the properties of algebra