Thursday, 29 September 2016

python - UnboundLocalError at inversing a string

def FirstReverse(str):


chaine = str.split(' ');

for i in range(len(chaine), -1):
inverse = chaine[i]
return inverse ;


print FirstReverse(raw_input())


i want to inverse a string but i have some difficulties , i got this error message




UnboundLocalError: local variable 'inverser' referenced before assignment


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...