Question: Must be done in Python. Please note that the program has to use recursive (recursion) functions and not loops or built-in Python functions. SUBMISSION INSTRUCTIONS
Must be done in Python. Please note that the program has to use recursive (recursion) functions and not loops or built-in Python functions.

SUBMISSION INSTRUCTIONS Submit 1 python file using the naming convention below (replace JaneDoe with your first and last name respectively): - JaneDoe7_1.py QUESTION 1. Write a program that contains the recursive functions below (please note for all the functions, you must use recursion and not loops or built in Python functions): a. def power (x,y) : This function should recursively compute the power of a number ( x represents the number and y represents the power to which its being raised assume y will always be a positive integer) e.g., i. print(power(2,3))#23=8 ii. print(power(2,3))#23=8 iii. print(power(1,5))#15=1 b. def cat_ears(n): If every cat has 2 ears, this function should recursively compute the total number of ears based off the number of cats (n represents the total number of cats) e.g., i. print(cat_ears (0)) \# 00 cats have 0 ears in total ii. print(cat_ears(1)) \#2 - 1 cat has 2 ears in total iii. print(cat_ears(2)) \# 42 cats have 4 ears in total c. def alien_ears(n): We have aliens standing in a line, numbered 1,2, The odd aliens (1,3,) have 3 ears. The even aliens (2,4,) have 2 ears. This function should return the total number of alien ears ( n represents the total number of aliens) e.g., i. print(alien_ears(1)) \# 3 - (alien 1 has 3 ears) ii. print(alien_ears(2)) \#5-(alien 1 has 3 ears, alien 2 has 2 ears)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
