1
Good night, you guys. My first post, I’m inciante and it may seem like a silly question but it’s keeping me up at night. I appreciate the help. In the code below, when pressing enter without typing anything in imput is returned an error and I tried everything but I still could not solve and I ended up not being able to follow the studies. Is there any way to fix it or is it normal?
cont = ('Zero', 'Um', 'Dois', 'Treis', 'Quatro', 'Cinco', 'Seis', 'Sete', 'Oito', 'Nove', 'Dez',
'Onze', 'Doze', 'Treze', 'Quatorze', 'Quinze', 'Desesseis', 'Desessete', 'Dezoito', 'Dezenove', 'Vinte')
for c in range(0, 20):
num = int(input('Digite um número entre 0 e 20: ')).
if 0 <= num <= 20:
print(f'Você digitou o número {cont[num]}')
next = str(input('Deseja continuar? [S/N] ')).upper().strip()[0]
if next == 'N':
break
else:
print('Valor inválido! Tente novamente.')
print('Fim do Programa')
Daniel Mendes, thank you very much for your answers. I will implement and sleep today rsrs.
– Guereir0