def factorial(n): if not isinstance(n, int): print('Factorial is only defined for integers') return None elif n < 0: print('Factorial is not defined for negative integers.') return None elif n == 0: return 1 else: return n * factorial(n-1)
10-31
2335
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)