Advertisement
182days

Recursion

May 10th, 2016
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. #recursion example
  2. #finds all values below a provided value
  3. x=int(input("Enter a number"))
  4. def steps(x):
  5.     if x == 0:
  6.         return 0
  7.     else:
  8.         return (x-1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement