Hyphenate Letters:
You are given a word W as input. Print W by adding a hyphen (-) between each letter in the word.
Input
The first line of input is a string W.
Explanation
In the given example, the word is Hello.
So, the output should be
H-e-l-l-o.
Sample Input 1
Hello
Sample Output 1
H-e-l-l-o
Sample Input 2
Everyone
Sample Output 2
E-v-e-r-y-o-n-e
W = input()
W = '-'.join(W[i:i + 1] for i in range(0, len(W), 1))
print(W)
Comments
Leave a comment