This commit is contained in:
louiscklaw
2025-01-31 21:15:04 +08:00
parent 3337cc3d1e
commit acf9d862ff
324 changed files with 43162 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
## 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):`