+ 1
How to fix this so that it could print in reverse?
def reverse (a_string): for i in range (len (a_string)-1,-1,-1) rev = rev + a_string [i] return rev reverse ("make this reverse") print (reverse)
1 Antwort
+ 1
def reverse (a_string):
rev = ""
for i in range (len (a_string)-1,-1,-1):
rev = rev + a_string [i]
return rev
print(reverse ("make this reverse"))