Apply new format to snippets and template

This commit is contained in:
Angelos Chalaris
2020-09-15 16:13:06 +03:00
parent 39d3711994
commit a9aeadad64
117 changed files with 170 additions and 175 deletions

View File

@ -5,10 +5,10 @@ tags: math,recursion,beginner
Calculates the factorial of a number.
Use recursion.
If `num` is less than or equal to `1`, return `1`.
Otherwise, return the product of `num` and the factorial of `num - 1`.
Throws an exception if `num` is a negative or a floating point number.
- Use recursion.
- If `num` is less than or equal to `1`, return `1`.
- Otherwise, return the product of `num` and the factorial of `num - 1`.
- Throws an exception if `num` is a negative or a floating point number.
```py
def factorial(num):