• 100% Satisfaction Guarantee
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5471
Experience:  B.Tech
20870358
R.R. Jha is online now

recursive function

(q1) Write a recursive function called power_of_2 that takes as parameter a number N and returns 2N. Use the fact that 2N is 2 multiplied by itself N times. DO NOT USE THE ** operator!

(q2) Write a recursive function called square_sum that takes a parameter a number N and returns the sum 12 + 22 + 32 + ... + N2.

(q3) Write a recursive function called listProd for the following problem: You are given as inputs: a list L of numbers, and a number N (which is the length of the list); need to compute and return the product of all the numbers in the list (that is L[0] * L[1] * L[2] * ... * L[N-1]).

Hi,

When do you need them ?

Thanks
Customer: replied 3 years ago.

Hi,

I need them as soon as possible please.

Thanks

Ok, i can write the formulas , is that ok ?

Customer: replied 3 years ago.

can't you write the whole 3 programs ?

I want to run the programs in my computer

I do not know which languaje are you using

I can give you the math formulas

Customer: replied 3 years ago.

I want to write these 3 programs in PYTHON.

I do not know about it, maybe if you can give me some example i can try

Customer: replied 3 years ago.

I need an expert in computer programming --- python !!

• Write a recursive function called power_of_2 that takes as parameter a number N and returns 2N. Use the fact that 2N is 2 multiplied by itself N times. DO NOT USE THE ** operator!
• Write a recursive function called square_sum that takes a parameter a number N and returns the sum 12 + 22 + 32 + ... + N2.
• Write a recursive function called listProd for the following problem: You are given as inputs: a list L of numbers, and a number N(which is the length of the list); need to compute and return the product of all the numbers in the list (that is L[0] * L[1] * L[2] * ... * L[N-1]).
Hello,

I'm RRJha and I'd be glad to help with your question. I'll write a program with these three functions and send to you soon.

Thanks
Customer: replied 3 years ago.

Hi RRJha,

Can you please tell me when will you approximately finish the program ?

Like how long do you need to finish it ?

It would take 15 minutes or so. I'll get back to you asap.
Customer: replied 3 years ago.

Thank you very much.

I will wait for your response.

Good luck.

Let me know which version of python are you using.
Customer: replied 3 years ago.

it's PYTHON 2.7.5