So i have created a user input where you can type in a function and it calculates it into a graph but my problem is the input is a str and if i type 2*x it cant convert to integer because of the non interger letters
x = 1
#The input from the user
function = "2*x+1"
#Trying to print a calculated version of my function
print(int(function))
this is just a prototype i want it to print the result like in this case "3" and not "2*x+1" if anyone knows the anwser pls write it thx in advance!