Possible Duplicate:
How to replace a string in a function with another string in Python?
I want to enter any string with any type of character, and if the character is an alphabet, I want to replace it with "^" and get it printed.
For example, if my input is replace('text-here'), I should get the output as "^^^^-^^^^".
I've tried using the following statement, but it just prints whatever my input was. Please help!
def replace(string):
for x in range(len(string)):
string.replace(string[x],"^")
print(string)
I'm new to python, and don't know complex stuff. Please give me easy-to-understand answers. Thanks!