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

What a character says is an example of what kind of characterization? description behavior dialogue description and dialogue
Which song exemplifies four-voice Renaissance polyphony, with each voice playing an equally important role? A. "Since Robin Hood" B. "My Lord Help Me to Pray"
How likely is it that food sales would exceed $220,000 if attendance is 18000?
Which element has the largest atomic radius
[tex]3x - y = 40[/tex]
Evaluate the following. 4x4+6divided by2-5
20. What nation was involved in the fighting on the Eastern European front during World War I? A. Spain B. Russia C. Ireland D. France
How did Prussia and Austria emerge as great powers in the seventeenth and eighteenth century Europe
Please help me!!!! This is due today pls help now!!!!!
The purpose of looping is to _____. A. determine your purpose B. choose a tone C. document sources D. narrow your topic