(base,exp)
| 60 | # 5..TO FIND THE POWER OF A NUMBER |
| 61 | |
| 62 | def power(base,exp): |
| 63 | assert exp>=0 and int(exp)==exp , "power can only be positive integers" |
| 64 | if(exp==0): |
| 65 | return 1 |
| 66 | if(exp==1): |
| 67 | return base |
| 68 | else: |
| 69 | return base*power(base,exp-1) |
| 70 | |
| 71 | print(power(2,5)) |
no outgoing calls
no test coverage detected