Answers for "how to add lists in python"

1

how to add lists to lists in python

fruits = ["watermelon","banana","Cherry","pineapple","oranges"]
vegitable = ["Tomato","potato","torry","bottle goud","bittre gourd"]
#adding fruits and vegitable in a list called dirty_dozen
dirty_dozen = [fruits, vegitable]
print(dirty_dozen)
Posted by: Guest on July-31-2021
1

add a list in python

list_of_names=["Bill", "John", "Susan", "Bob", "Emma","Katherine"]
new_name="James"
list_of_names.append(new_name)
# The list is now ["Bill", "John", "Susan", "Bob", "Emma","Katherine", "James"]
Posted by: Guest on April-19-2021

Python Answers by Framework

Browse Popular Code Answers by Language