Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # factorial_format.py
- def factorial(x):
- if x < 0:
- return("Error!")
- elif x==0:
- return(0)
- else:
- return(x*x)
- for x in xrange(-1,10+1):
- print('{var} x {var} = {ans}'.format(var=x,ans=factorial(x)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement