运行报错:
AttributeError: 'int' object has no attribute 'append'
序号=[]
数字=[]
for 数 in range(1,10):
数字.append(数)
for 数字 in 数字:
if 数字==1:
序号.append('1st')
elif 数字==2:
序号.append('2nd')
elif 数字==3:
序号.append('3rd')
else:
序号.append(str(数字)+'th')
print(序号)
AttributeError: 'int' object has no attribute 'append'
尝试用list(),没有解决
序号='1st,2nd,3rd,4th,5th……'
for 数字 in 数字:
自己看看自己写的玩意
厉害,👍🏻还中文