Exerpad
Exercise 6 · Chapter: ListsRequired+50 XP

Fix the Append

This code is trying to add "grape" to the list of fruits, but it's doing it the wrong way and will cause an error.

Fix the code so it correctly adds "grape" to the end of the list and prints the result.

Hint: You can't add a string to a list with +. Use the right list method instead!

Expected output
['apple', 'banana', 'grape']
Need a hint?
3 available · costs 5 XP each
python
fruits = ["apple", "banana"]
fruits = fruits + "grape"
print(fruits)
Output
Run your code to see the output here.