0
Hello, I’m starting programming and I’m studying Python. Performing an exercise I managed to get the expected result. However, when I try to do the same program by converting the list to INT, it doesn’t work. Shows output error, even add a class int in the Print command. Can anyone ask me this question?
lista_numeros = ['1', '2', '3', '4', '5', '6', '7', '8', '9']
for lista in lista_numeros:
if lista == '1':
print(lista + 'st')
elif lista == '2':
print(lista + 'nd')
elif lista == '3':
print(lista + 'rd')
else:
print(lista + 'th')
What would be the problematic code? That?
– Breno
I just tested your code and there was no error.
– Augusto Vasques