20 lines
1012 B
Markdown
20 lines
1012 B
Markdown
## Mandatory
|
||
|
||
- P01: Please use recursion to define and test a function to calculate the sum of a list of numbers.
|
||
`def list_sum_Recur(num_list):`
|
||
- P02: Please use recursion to define and test a function to find the greatest common division of two positive integers.
|
||
`def gcd_Recur(a,b):`
|
||
- P03: Please use recursion to define and test a function to calculate the harmonic series upto `n` terms.
|
||
`def harmonic_sum_Recur(n):`
|
||
- P04: Please use recursion to define and test a function to calculate the value of 𝑥 to the power of `n`.
|
||
`def power_Recur(x,n):`
|
||
|
||
## Optional
|
||
|
||
- P05: Please use recursion to define and test a function to accept a decimal integer and display its binary equivalent.
|
||
`def Dec2Binary_Recur(num):`
|
||
- P06: Please use recursion to define and test a function to take in a string and returns a reversed copy of the string.
|
||
`def reverse_Recur(a,b):`
|
||
- P07: Please use recursion to define and test a function to check whether a number is Prime or not.
|
||
`def isPrime_Recur(a,b):`
|