Write a program to replace the string space with a given character using loop?

word=“Apple juice”
empty_string = " "
space=“-”

for i in word:
if i==" ":
i=space
empty_string+=i

print(empty_string)

@brindhubala30

Correct keep it up.

1 Like

@dsedyoda thank you mam…

1 Like