Question: In your Python file (YourLastName_Your FirstName_hw2.py), add the following recursive functions: (10 pts each) Write a recursive function named natural(n) to print out the
In your Python file (YourLastName_Your FirstName_hw2.py), add the following recursive functions: (10 pts each) Write a recursive function named natural(n) to print out the first n natural numbers. Write a recursive function named GCD(n, m) to find the greatest common divisor of two integers. For example, the GCD of 24 (2x2x2x3) and 18 (2x3x3) is 6. Write a recursive function named power(n, m) to calculate the power of an integer nm. Write a recursive function named reverse(string) to reverse a string. Write a recursive function named digits(n) to count the digits of the given integer n. I
Step by Step Solution
There are 3 Steps involved in it
The answer provided below has been developed in a clear step by step manner Step 1 Program Description This program helps us to create recursie functi... View full answer
Get step-by-step solutions from verified subject matter experts
