#练习5-11:序数
digits=list(range(1,10))
for digit in digits:
print(digit)
if digit ==1:
print('1st')
elif digit ==2:
print('2nd')
elif digit ==3:
print('3rd')
else:
print(f"{}th")
《Python 编程》第五章练习-序数
最新推荐文章于 2024-08-19 14:41:29 发布
#练习5-11:序数
digits=list(range(1,10))
for digit in digits:
print(digit)
if digit ==1:
print('1st')
elif digit ==2:
print('2nd')
elif digit ==3:
print('3rd')
else:
print(f"{}th")