SHARE
TWEET

Untitled

a guest Oct 20th, 2019 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def factorial(input):
  2.     """This function only supports positive numbers. Takes a number and returns its factorial """
  3.     input = abs(input)
  4.     if input is 1:
  5.         return 1;
  6.     else:
  7.         return input * factorial(input-1)
  8.  
  9. print(factorial(-5))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top