← Back to the lesson: String Methods
Split String
The exercise
Given: data = "apple,banana,cherry"
Split the string by comma to create a list.
Print the second fruit (banana).
Starter code
data = "apple,banana,cherry"
# Split by comma / Разделите по запятой
fruits =
# Print second fruit / Выведите второй фрукт
Write the code in the browser and run it — no installation needed.