184k views
1 vote
Does anyone know how to use a while loop to print the numbers 84, 81, 78, 75, 72, 69, 66, 63, 60, 57, 54, 51, 48, 45, 42, 39, 36, 33, 30, 27, and 24 in order on the same line with a space in between each number on edhesive?

If so this would help me out a lot

User Hidayat
by
5.6k points

1 Answer

2 votes

In python:

i = 84

while i >= 24:

print (i, end=" ")

i -= 3

I hope this helps!

User Dragas
by
5.7k points