what I have done is -
def reverse(i, j, lstr):
if j == 0:
return []
if j == 1:
return lstr
if i>j:
return lstr
temp = lstr[i]
lstr[i] = lstr[j]
lstr[j] = temp
print(reverse(i+1, j-1, lstr))
It is returning -
['o', 'l', 'l', 'e', 'h']
None
None
None
why is it returning None 3 times? How can I fix this?