I'm trying to make a code that finds special characters and replace them in to *.
For example:
L!ve l@ugh l%ve
This should be changed as
L*ve l*ugh l*ve
Here it's what I tried so far
a = input()
spe = "+=/_(*&^%$#@!-.?)"
for i in a:
if i in spe:
b = a.replace(i,"*")
else:
b = i
print(b,end="")
This returns something like this
Lve lugh lve
Why I'm getting like this?
And how to solve this issue?