From edf9812fe7a169a6f5045ea9efe7e0ac12107e86 Mon Sep 17 00:00:00 2001 From: Shravani-1212 <115860437+Shravani-1212@users.noreply.github.com> Date: Sat, 15 Oct 2022 12:35:11 +0530 Subject: [PATCH] Update factorial.py --- factorial.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/factorial.py b/factorial.py index 7b24c2a..8d80864 100644 --- a/factorial.py +++ b/factorial.py @@ -6,8 +6,8 @@ # check if the number is negative, positive or zero if num < 0: print("Sorry, factorial does not exist for negative numbers") -#issue - if the num = 0 then its factorial is 1. -#add a condition for that. +elif num == 0: + print("The factorial of 0 is 1") else: for i in range(1,num + 1): factorial = factorial*i