String Split and Join Hackerrank Solution
For Explanation Watch Video:
Sample Input
this is a string
Sample Output
this-is-a-string
Code:
def split_and_join(line): # write your code here line = line.split(" ") line = "-".join(line) return line
if __name__ == '__main__': line = input() result = split_and_join(line) print(result)
Comments
Post a Comment