Python: Insert Into List

Post Reply
User avatar
Jason
Site Admin
Posts: 767
Joined: Sun Dec 21, 2025 8:56 pm

Code: Select all

small_list_of_plants = list(("mushroom", "poison ivy", "grass"))

small_list_of_plants.insert(1, "potato")

print(small_list_of_plants)

# Will display ['mushroom', 'potato', 'poison ivy', 'grass']
 

POSTREACT(ions) SUMMARY

Post Reply