Update code in factorial

This commit is contained in:
Angelos Chalaris
2020-01-03 13:00:33 +02:00
parent ca487b45a6
commit 5c0bbda612

View File

@ -13,8 +13,7 @@ Throws an exception if `num` is a negative or a floating point number.
```py
def factorial(num):
if not ((num >= 0) and (num % 1 == 0)):
raise Exception(
f"Number( {num} ) can't be floating point or negative ")
raise Exception("Number can't be floating point or negative.")
return 1 if num == 0 else num * factorial(num - 1)
```