I have created a python function that should permanently change the string passed as argument to the function, by reversing it.
hello="hello"
def reverse(string):
reversed_string=""
for x in range(len(string)-1,-1,-1):
reversed_string+=string[x]
string=reversed_string
reverse(hello)
print (hello)
Yet it still prints "hello", on the last line. Why is it not changing the variable passed into it? It should print "olleh" on the last line.