Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

question 7 write a python while loop that counts up from 1 to 20, print…

Question

question 7
write a python while loop that counts up from 1 to 20, printing each number as it goes
edit format table
12pt paragraph b i u a t²

Explanation:

Step1: Initialize a variable

i = 1

Step2: Set up the while - loop condition

while i <= 20:

Step3: Print the number and increment the variable

    print(i)
    i += 1

Answer:

i = 1
while i <= 20:
    print(i)
    i += 1