Program -You are given a string. Split the string on a " " (space) delimiter and join using a - hyphen.


Topic: Program -You are given a string. Split the string on a " " (space) delimiter and join using a - hyphen.

Solution

def word_join(s):
    words = s.split(' ')
    return '-'.join(words)
print(word_join("This is 17B Assignment"))



List all Python Programs