Files
004_comission/max015/CDS2003_assignment02/_ref/digest.md
louiscklaw acf9d862ff update,
2025-01-31 21:15:04 +08:00

1012 B
Raw Blame History

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):