I am writing a python function that prints the reverse of a given function. My solution should be for example if the given expression is 200+500-600 my output should be 600-500+200. My code however is giving me 006-005+200. Any help on how to fix, here's my code.
def reverse(s):
if len(s) == 0:
return s
else:
return reverse(s[1:]) + s[0]
s = "100+200-300"
print ("The original string is : ",end="")
print (s)
print ("The reversed string(using recursion) is : ",end="")
print (reverse(s))