mardi 26 juin 2018

Recursion to print the sum of first ten numbers using a single like if else in Python

def ad(a): 
    return a+ad(a+1) if a<10 else return a ad(1)
ad(1)

Returns an error that tells invalid syntax any thoughts?

Aucun commentaire:

Enregistrer un commentaire