Well done!

You have completed Review Mutability!

Quiz Question 1 of 2

Consider the following code:

all_restaurants = [
    "Taco City",
    "Burgertown",
    "Tacovilla",
    "Hotdog station",
    "House of tacos",
]

def tacos_only(restaurants):
    taco_joints = restaurants.copy()
    for taco_joint in taco_joints.copy():
        if "taco" not in taco_joint.lower():
            taco_joints.remove(taco_joint)
    return taco_joints

dinner_options = tacos_only(all_restaurants)

Why do you think the author used the copy method in the for loop here:

    for taco_joint in taco_joints.copy():

Choose the correct answer below:

Skip Quiz Review Video