Ok, so i want the "y = x/2" part assign to "operation" input, so i can change that equation through the console.
operation = input("operation: ")
y = 0
axis_x = list(range(10))
axis_y = []
for x in axis_x:
y = x/2
print(y)
axis_y.append(y)
when i change it to this:
operation = input("operation: ")
y = 0
axis_x = list(range(10))
axis_y = []
for x in axis_x:
operation
print(y)
axis_y.append(y)
nothing happends, i just want to make equations thru the console, i want to type in the console "y = x/2", but that just doesnt work. I tried .format() too, but the same problem. somebody help, thanks!
y = x/2will not be same as'y = x/2'. You might want to evaluate your user input, but are you sure you need this?