(n)
| 1 | # 1..TO FIND FACTORIAL OF A NUMBER USING RECURSION |
| 2 | |
| 3 | def factorial(n): |
| 4 | assert n>=0 and int(n)==n , "the number must be positive integer only" |
| 5 | if n==0 or n==1: |
| 6 | return 1 |
| 7 | else: |
| 8 | return n*factorial(n-1) |
| 9 | |
| 10 | print(factorial(4)) |
| 11 |
no outgoing calls
no test coverage detected