Exercise: Functions: join()

Write a function join() that takes a string list strings and a string separator as parameter. It joins strings together into a single string, using separator as a separator. For example,

  • join(['Hello', 'World'], '-') returns 'Hello-World'

  • join(['Hello'], '-') returns 'Hello'

  • join([], '-') returns '' (the empty string)