11. Write a python program to join a list of fruits as provided in the following output with a symbol '-' in between fruits.
The output is:
fruits = ['Apple', 'Grapes', 'Berry', 'Mango']
Expected Answer:
All fruits are: Apple-Grapes-Berry-Mango
Sample Answer:
fruits = ['Apple', 'Grapes', 'Berry', 'Mango'] combine_fruits = '-'.join(fruits) print("All fruits are: "+combine_fruits)
More Exercises:
Python String ExercisesMore Numpy Exercises:
Numpy String ExercisesMore Pandas Exercises:
Pandas Series ExercisesMore Tutorials:
Python Installation - Linux (Ubuntu)