diff options
1 files changed, 13 insertions, 0 deletions
| -rw-r--r-- | homework/81350/parser/colapser/input.file | 13 |
diff --git a/homework/81350/parser/colapser/input.file b/homework/81350/parser/colapser/input.file new file mode 100644 index 0000000..223392d --- /dev/null +++ b/homework/81350/parser/colapser/input.file @@ -0,0 +1,13 @@ +def func(): + num = 7 + + factorial = 1 + + if num < 0: + print("Sorry, factorial does not exist for negative numbers") + elif num == 0: + print("The factorial of 0 is 1") + else: + for i in range(1,num + 1): + factorial = factorial*i + print("The factorial of",num,"is",factorial) |
