recursion - Create a Python recursive function that prints all the integers less than or equal to the value provided in the original call -
i=0 def recursiveintegers(n): if n==1: return 1; else: reqval= n-1; print("less or equal original -->",reqval); return recursiveintegers(reqval) uservalue = int(input("enter value ")) recursiveintegers(uservalue)
what missing print out equal values..?
print 'n' first ... 'reqval = n-1'
Comments
Post a Comment