def retorna(valor, limite, soma):
if valor > limite:
return soma
return retorna(valor + 1, limite, soma + valor)
print(retorna(1, 5, 0))
#https://pt.stackoverflow.com/q/328197/101
ZGVmIHJldG9ybmEodmFsb3IsIGxpbWl0ZSwgc29tYSk6CiAgICBpZiB2YWxvciA+IGxpbWl0ZToKICAgICAgICByZXR1cm4gc29tYQogICAgcmV0dXJuIHJldG9ybmEodmFsb3IgKyAxLCBsaW1pdGUsIHNvbWEgKyB2YWxvcikKcHJpbnQocmV0b3JuYSgxLCA1LCAwKSkKCiNodHRwczovL3B0LnN0YWNrb3ZlcmZsb3cuY29tL3EvMzI4MTk3LzEwMQ==