In: Computer Science
2. Solve a function (e.g., y(x) = sin(x) / (sin(x/10) + x/10) for many different values of x between a user-defined min and max, and store the values in a list. Also, print the maximum value of y(x) for the given range.?
import math
#define your function here
#x will be in radians
def functio(x):
return math.sin(x)/(math.sin(x/10)+x/10)
mi=int(input("Enter min: "))
ma=int(input("Enter max: "))
lis=[]
#storing in list "lis" from mi to ma (both inclusive)
for i in range(mi, ma+1):
lis.append(functio(i))
print("The values in list are: ",end="")
print(lis)
print()
print("The maximum value in given range is: "+str(max(lis)))
PLEASE LIKE IT RAISE YOUR THUMBS UP
IF YOU ARE HAVING ANY DOUBT FEEL FREE TO ASK IN COMMENT
SECTION