Replacing string character in python : <p>I am making a program where the user inputs some text, and I wan't all the characters in that text that is not in the variable "alfabet" to be changed to "?". How can I do this? I also want a to do it in two functions, main and clean_text. My code looks like this now:</p>

<pre><code>def clean_text():
for char in text:
if char in alfabeth:
continue
elif char not in alfabeth:
#don't know what to do here
#text[] = "?"

def main():
userInput = input("type in text: ")
text = list(userInput)

if__name__ == "__main__":
main()
clean_text(text)
</code></pre>
