Quick actions

cmd+k|ctrl+k

Navigation

Languages

Exercise about The List Methods 

Snippet info

Language

Python

Visibility

public

Author

ericmash53

Created

2026-03-28T11:11:51.515158Z

Updated

2026-03-28T17:20:59.620975Z

# Exercise List Methods
# SCROLL FOR ANSWERS!
# using this list,

basket = ["Banana", "Apples", "Oranges", "Blueberries"]

# 1. Remove the Banana from the list

# 2. Remove "Blueberries" from the list.

# 3. Put "Kiwi" at the end of the list.

# 4. Add "Apples" at the beginning of the list

# 5. Count how many apples in the basket

# 6. empty the basket

# 1. Remove the Banana Fromt he List

basket.remove("Banana")
print(basket)

# 2. Remove Blueberries from the list
basket.remove("Blueberries")
print(basket)

# 3. Put "Kiwi" at the end of the list
basket.append("Kiwi")
print(basket)

# 4. Add "Apples" at the beginning of the list
basket.insert(0, "Apples")
print(basket)

# 5. Count how many apples in the basket
print(basket.count("Apples"))

# 6. Empty the List
basket.clear()
print(basket)
INFO