0
I’m having trouble capturing the input of more than one integer into one input.
Ex:
numero = int(input('Digite o primeiro número aqui: '))
numero_1 = int(input('Digite o segundo número aqui: '))
numero_2 = int(input('Digite o terceiro número aqui: '))
lista_numeros = [numero, numero_1, numero_2]
I would like to turn these 3 input’s into one.
Ex:
numeros = int(input('Digite os números aqui: '))
lista_numeros = [numeros]
but this second execution makes an error of:
Valueerror: invalid literal for int() with base 10: '1 2 3 5'
I believe it may be because of the gaps between the numbers.
Thank you very much. Just a doubt I had here, this 'v' that was defined is only any variable can be X , Y or Z for example ?
– Pedro Henrique
Yes, it is created in the scope of the list comprehension and you can give the variable the name you want. In a Portuguese notation:
valor para valor em variaveInteravel
– gato
Okay, thank you so much for your help!!
– Pedro Henrique