root_1 = int(input("What is root 1?")) root_2 = int(input("What is root 2?")) vertex_x = int(input("What is the x-value of the vertex?")) vertex_y = int(input("What is the y-value of the vertex?")) root_sum = root_1 + root_2 root_product = root_1 * root_2 #This is where the code for the calculator will begin. #This line calculates the bulk of the math. equation = ((vertex_x * vertex_x) - (root_sum * vertex_x) + (root_product)) #This line will give us the variable "a" a = vertex_y / equation #This line will multiply the whole equation by "a". part_2 = a * root_sum part_3 = a * root_product print " f(x)=" + str(a) + "x^2+" + str(part_2) + "x+" + str(part_3) + ""
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question