I am trying to write a simple function to take a char out of a user input in python but keep getting the following error:
Traceback (most recent call last):
File "C:/Users/chris/Desktop/Python_Stuff/replace.py", line 4, in <module>
new= old.replace("*","")
NameError: name 'old' is not defined
This is my code:
def remove_char(old):
old =input("enter a word that includes * ")
return old #do I even need this?
new= old.replace("*","")
print (new)
Thanks in advance for the help!