Procedure to help with my assignments

a. What is the derivative of 2x^5 - 6x^2 + 24x?

import numpy as np
 
# defining polynomial function
var = np.poly1d([2, 0, 0, 6, 24, 0])
print("Polynomial function, f(x):\n", var)
 
# calculating the derivative
derivative = var.deriv()
print("Derivative, f(x)'=\n", derivative)
 
# calculates the derivative of after
# given value of x
print("When x=9  f(x)'=", derivative(9))
Polynomial function, f(x):
    5     2
2 x + 6 x + 24 x
Derivative, f(x)'=
     4
10 x + 12 x + 24
When x=9  f(x)'= 65742

b. What is the derivative of (13x^4 + 4x^2) / 2 when x = 9?

import numpy as np
 
# defining polynomial function
var = np.poly1d([13, 0, 4, 0, 0])/2
print("Polynomial function, f(x):\n", var)
 
# calculating the derivative
derivative = var.deriv()
print("Derivative, f(x)'=\n", derivative)
 
# calculates the derivative of after
# given value of x
print("When x=9  f(x)'=", derivative(9))
Polynomial function, f(x):
      4     2
6.5 x + 2 x
Derivative, f(x)'=
     3
26 x + 4 x
When x=9  f(x)'= 18990.0
import random

dogs = ["Fido", "Rufus", "Spot", "Buddy", "Max", "Charlie", "Rocky", "Molly", "Roxy", "Tucker"]
cats = ["Fluffy", "Whiskers", "Mittens", "Socks", "Oliver", "Smokey", "Boots", "Lucy", "Princess", "Simba"]

random.shuffle(dogs)
random.shuffle(cats)

print(dogs)
print(cats)
['Max', 'Buddy', 'Tucker', 'Fido', 'Charlie', 'Spot', 'Roxy', 'Rocky', 'Molly', 'Rufus']
['Princess', 'Oliver', 'Whiskers', 'Mittens', 'Smokey', 'Socks', 'Fluffy', 'Boots', 'Lucy', 'Simba']