Calculator code

I am having trouble coding my distance/midpoint calculator in my chatter 2.0. I have written my calculator code on a website called The problem I have is that I can’t figure out how to code it in a way that uses the buttons to input the numbers. To any one who knows how to do that, please send me the python code so I can use it on my chatter.
This is the python code.
import math
x1=float(input(β€œEnter x1.”))

y1=float(input(β€œEnter y1.”))

print((β€œ(”)+str(x1)+(" , β€œ)+str(y1)+(”)."))

x2=float(input(β€œEnter x2.”))

y2=float(input(β€œEnter y2.”))

print((β€œ(”)+str(x2)+(" , β€œ)+str(y2)+(”)."))











print((β€œThe equation for the distance is √(”)+(str(x2))+(β€œ-”)


print(β€œThe steps are as follows:”)

print(("1. Subtract β€œ)+(str(x1))+(” from ")+(str(x2))

+(" which equals β€œ)+(str(x3))+(”."))

print(("2. Subtract β€œ)+(str(y1))+(” from ")+(str(y2))

+(" which equals β€œ)+(str(y3))+(”."))

print(("3. Multiply ")+(str(x3))

+(" to the power of 2 which equals β€œ)+(str(x4))+(”."))

print(("4. Multiply ")+(str(y3))

+(" to the power of 2 which equals β€œ)+(str(y4))+(”."))

print(("5. Add β€œ)+(str(x4))+(” to ")+(str(y4))

+(" which equals β€œ)+(str(a1))+(”."))

print(("6. Find the square root of β€œ)+(str(a1))+(” which equals ")


print(β€œThat is your distance.”)

print((β€œIf you get a realy big number then just write βˆšβ€)+(str(a1))

+(" for you distance.\n"))

print((β€œThe equation for midpoint is ((”)+(str(x1))+(β€œ+”)+(str(x2))


print(β€œThe steps are as follows:”)

print(("1. Add β€œ)+(str(x1))+(” to β€œ)+(str(x2))+(” which equals ")


print(("2. Divide β€œ)+(str(x5))+(” by 2 which equals ")+(str(x6))

+(β€œ. This is the X coordinate of \nthe midpoint.”))

print(("3. Add β€œ)+(str(y1))+(” to β€œ)+(str(y2))+(” which equals ")


print(("4. Divide β€œ)+(str(y5))+(” by 2 which equals ")+(str(y6))

+(β€œ. This is the Y coordinate of \nthe midpoint.”))

print((β€œThe midpoint is β€œ)+”(”+str(x6)+β€œ,”+str(y6)+β€œ).”)