Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

add to list python

fruits = ["Apple", "Banana"]

# 1. append()
print(f'Current Fruits List {fruits}')

f = input("Please enter a fruit name:
")
fruits.append(f)

print(f'Updated Fruits List {fruits}')
Source by www.journaldev.com #
 
PREVIOUS NEXT
Tagged: #add #list #python
ADD COMMENT
Topic
Name
5+7 =