Advertisement
BlackGuard26

Indented block error

Jan 8th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. def factorial(n):
  2.     if(n < 0):
  3.         return None
  4.     elif(n == 0):
  5.         return 1
  6.     else:
  7.         a = 1
  8.         i = 1
  9.         while(i <= n):
  10.             a = a * i
  11.             i = i + 1
  12.         return a
  13.        
  14. factorial(input('Hai: '))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement