Skip to main content

Posts

Showing posts with the label String Split and Join Hackerrank Solution

String Split and Join Hackerrank Solution Python

 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)