From 5c0bbda61219ebce8aa5145bf45163d139290455 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 3 Jan 2020 13:00:33 +0200 Subject: [PATCH] Update code in factorial --- snippets/factorial.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/snippets/factorial.md b/snippets/factorial.md index d66ab2cd4..e69783877 100644 --- a/snippets/factorial.md +++ b/snippets/factorial.md @@ -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) ```