Printing a list of ordinal numbers

I have created a simple for loop to loop through a range of numbers 1-9

for numbers in range(1, 10):
print(numbers)

Easy.

Can anyone help me change the program so that it prints the list with ordinal numbers? I am being asked to create a if-elif-else chain inside the loop, but I don’t know how to do that.

Thankyou in advance

Si

1 Like

for number in range(1, 10):
   if something:
       print("first")
   elif something:
       print("second")
   elif something:
       print("third")
   elif # and so on

All you need to do is fix the “somethings”.

Thanks Steven, that’s sorted it