Menu Close

Program to remove add “Hyphen” character in the entered string

Write a python program to remove add “Hyphen” character in the entered string. Or can add any other than a Hyphen.

string=input("Enter the string: ")
print(string.replace(" ","-"))

Input:
           Enter the string: Hello world it is kinda cliche
Output: 
           Hello-world-it-is-kinda-cliche


Exec. on linux

Morae!Q!