Answers for "how to add values to list"

3

how to add values to a list in python

myList = []
myList.append(value_to_add)
Posted by: Guest on August-31-2020
0

add item to python list

#Add item to python list
languages = ['C', 'Kotlin', 'Javascript']
user_input = input('Enter a programming language...')
languages.append(user_input)
for i in languages:
  print(i)
#Result
>>Enter a programming language...[ Python|    ]
>>'C'
>>'Kotlin'
>>'Javascript'
>>'Python'
Posted by: Guest on July-31-2021

Code answers related to "how to add values to list"

Python Answers by Framework

Browse Popular Code Answers by Language