Question: 1. Write a function plus_student_id(n) that adds your coyote id to n. Hint: Python most likely will reject a number with multiple leading zeros. If

1. Write a function plus_student_id(n) that adds your coyote id to n. Hint: Python most likely will reject a number with multiple leading zeros. If you define a term similar to

my_student_id = int('000012345') then my_student_id will be a proper integer.

2. Write a function cube(n) that finds the n_th cube. Is this a closed formula or recursive?

3. Write a recursive function that finds the sum of the first n squares, 1^2 +2^2 + ... + n^2

4. include the following code, with my_student_id set as above:

import random random.seed(my_student_id) a = random.randint(1,10) b = random.randint(1,10)

then define a recurseive function g(n) that returns:

a if n=1 b if n=2

g(n-1)+g(n-2) if n > 2.

This is in pyhton.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!