We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Strings
- String Split and Join
- Discussions
String Split and Join
String Split and Join
+ 0 comments may this code helps u def split_and_join(line): l=line.split() s="" for i in l: s=s+i+"-" s=s.strip("-") return s
+ 0 comments may this code helps u def split_and_join(line): l=line.split() s="" for i in l: s=s+i+"-" s=s.strip("-") return s
+ 0 comments may this code helps u def split_and_join(line): l=line.split() s="" for i in l: s=s+i+"-" s=s.strip("-") return s
+ 0 comments may this code helps u def split_and_join(line): l=line.split() s="" for i in l: s=s+i+"-" s=s.strip("-") return s
+ 0 comments def split_and_join(line): # write your code here return "-".join(line.strip() for line in line.split()) if __name__ == '__main__': line = input() result = split_and_join(line) print(result)
Load more conversations
Sort 823 Discussions, By:
Please Login in order to post a comment