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

A rod “X”, has a positive charge of 5. An otherwise identical rod, “Y”, has a negative charge of 12. The rods are touched together and then separated. a) When t
what is the answer to this pls
Describe the human rights violation ​
Which BEST describes why a pharmacy technician would need to be familiar with OTC drugs? a. so the pharmacy technician can advice patients on which drugs to tak
ABCD is a rectangle. Point K is halfway between A and D. Find the coordinates of K.
In a non-mutated DNA strand, what base pairs with guanine?​
Now can someone help me with this? Here is the story.
Explain how land breeze and sea breezes occur?
how does the south African higher education institutions address student challenges in the central applications office ​
Hheeeelllllppppp qqquuuiiiccckkk