Function to calculate the factorial of a number. Takes a number as an argument, calculates the factorial of the number, and returns the result.
(num)
| 53 | |
| 54 | |
| 55 | def factorial(num): |
| 56 | """ |
| 57 | Function to calculate the factorial of a number. |
| 58 | |
| 59 | Takes a number as an argument, calculates the factorial of the number, |
| 60 | and returns the result. |
| 61 | """ |
| 62 | answer = 1 |
| 63 | for i in range(num): |
| 64 | answer *= i + 1 |
| 65 | return answer |
| 66 | |
| 67 | |
| 68 | def complex_arithmetic(): |