I've been working on this all day to no avail, I've spent all of about 4 hours researching a possible answer because I like to discover things on my own but I can't seem to move any closer.
Im writing a function that takes a string and with this string I have to convert each character to a symbol, excluding spaces and dashes.
I've tried creating a banking system for it as well but it seems like it only iterates over the first element, does this have something to do with return?
def get_view(puzzle):
for elements in puzzle:
new_ string = elements.replace(elements, "$")
return new_string
EDIT: I tried :
HIDDEN = "^" new_string = ""
def get_view(puzzle):
for elements in puzzle:
new_string = puzzle.replace(elements, HIDDEN)
return new_string
And now that returns
get_view("abc") 'ab^'
Wtttfffff.