You are given a word as input. Print the input by adding a hyphen (-) between each letter in the word.
The input is a string
Sample input == Hello
Output == H-e-l-l-o
data = input("Please enter your text: ")
for i in range(len(data)):
if i != len(data) - 1:
print(data[i] + '-', end='')
else:
print(data[i])
Comments
Leave a comment