Skip to content

Commit 0137b6e

Browse files
Merge pull request geekcomputers#416 from outoftune2000/master
Add replacetext file
2 parents c35f239 + 8eaccbc commit 0137b6e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

replacetext.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
#program to replace all the spaces in an entered string with a hyphen"-"
4+
def replacetext(string):
5+
string=string.split(" ")
6+
string="-".join(string)
7+
return string
8+
S=input("Enter a text to replace all its spaces with hyphens: ")
9+
N=replacetext(S)
10+
print("The changed text is: ",N)

0 commit comments

Comments
 (0)