Completed 5-11 Ordinal Numbers

This commit is contained in:
cheeks 2025-01-26 13:43:20 -05:00
parent 52e22103bc
commit 637a5ac11b

View File

@ -0,0 +1,20 @@
# Exercise 5-11 Ordinal Numbers
# Learning Objective: Iterations in a list.
nums = []
for num in range(1,10):
nums.append(num)
print(nums)
for num in nums:
if num == 1:
print(str(num) + "st")
elif num == 2:
print(str(num) + "nd")
elif num == 3:
print(str(num) + "rd")
else:
print(str(num) + "th")