Write a program to print the numbers from 20 to 1 using a loop.
Code:
for num in range(20, 0, -1):
print(num)
print("or")
num = 20
while num >= 1:
print(num)
num -= 1
Write a program to print the numbers from 20 to 1 using a loop.
Code:
for num in range(20, 0, -1):
print(num)
print("or")
num = 20
while num >= 1:
print(num)
num -= 1
0 Comments