Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

what is the output of this program? numa = 10 for count in range(5): nu…

Question

what is the output of this program? numa = 10 for count in range(5): numa = numa + 2 print (numa) output:

Explanation:

Step1: Initialize variable

numA is initialized as 10.

Step2: First iteration

In the first iteration of the for - loop, numA = numA+2, so numA=10 + 2=12.

Step3: Second iteration

In the second iteration, numA = 12+2 = 14.

Step4: Third iteration

In the third iteration, numA = 14+2 = 16.

Step5: Fourth iteration

In the fourth iteration, numA = 16+2 = 18.

Step6: Fifth iteration

In the fifth iteration, numA = 18+2 = 20.
After the loop finishes, the value of numA is printed.

Answer:

20