In: Computer Science
Code Screenshot :
Executable Code:
#Required function
def combine(myList,seperator):
#An empty string
final = ""
#Looping through the list
for i in myList:
#Appending string to final
and adding seperator
final+=i+seperator
#Return the result
return final[:-1]
#Testing the function
print(combine(["This","is", "string"],"-"))
Sample Output :
Please comment below if you have any queries or require any
modifications.
Please do give a thumbs up if you liked the answer thanks :)