+ 1
Replacing number in a string by 0(zero)
This is my code. it does not work. My goal is to replace numbers in the string by 0 str=input() for i in range(len(str)): if ord(str[i])>=48 and ord(str[i])<=57: str.replace(str[i],"0") print(str) //Help me...
1 Antwort
+ 1
str=input()
for i in range(len(str)):
if ord(str[i])>=48 and ord(str[i])<=57:
str=str.replace(str[i],"0")
print(str)