Begin26. Find the value of the function \(y = 4(x - 3)^6 - 7(x - 3)^3 + 2\) for a given value of \(x\).

Solution in Python 3:

import random

x = random.randrange(-10, 11)
print("x = ",x)
t = (x-3)**3
y = 4*t**2 - 7*t + 2
print("4*({0}-3)^6 - 7*({0}-3)^3 + 2 = {1}".format(x,y))