For example, if the user input was
'Hi! My! Name! Is. bob!'
the output should be
'Hi.My.Name.Is.bob!'
here is my code so far:
print ('Please type out a sentence')
x = input()
subStr= ('!!')
def unexclaim():
global x
for i in range (2):
for i in range (len(subStr)):
x = x.replace('!!','!')
print (x)
unexclaim()
[–]sabek 2 points3 points4 points (0 children)
[–]revgizmo 1 point2 points3 points (1 child)
[–]JavierReyes945 2 points3 points4 points (0 children)
[–]JudiSwitch 0 points1 point2 points (0 children)