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 is 7.75 in word form?
The process of grouping things based on their similarities is?
Anne and toms grandmother gave them £84 which was to be shared in the ratio of 5:2 how much did each get ?
a^2=-42+13a solve by factoring ?
can u help me on #7? when you get an answer the pick your answer on the second pic!!!! dont pick T or C!!!!
The process of grouping things based on their similarities is?
How successful were the socialists and communists in exploiting the unrest caused by the Depression?
Could someone help me please? I am completely lost on how to figure out this problem.Use Synthetic division to show that x is a solution for the third degree po
n+5(n-1)=7 help me i dont get it
Please help In the sequence below the first term is 2 and each term after the first is k times the preceding term where k is a constant. What is the value of th