Add a new value to a list

Asked

Viewed 437 times

3

Is there any way to add a new value to a Python list from a user input?

Example:

Entrada = int(input("Digite um número"))    
lista = [] #A partir da entrada acima eu gostaria de expandir esta lista

1 answer

3


Yes. Using append

lista.append(Entrada)
  • Thanks, it worked.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.