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 py3.codeskulptor.org. 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)+(”)."))

x3=x2-x1

x4=x3**2

y3=y2-y1

y4=y3**2

a1=x4+y4

a2=math.sqrt(a1)

x5=x1+x2

x6=x5/2

y5=y1+y2

y6=y5/2

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

+(str(x1))+(β€œ)Β²+(”)+(str(y2))+(β€œ-”)+(str(y1))+(β€œ)²”))

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 ")

+(str(a2))+(β€œ.”))

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))

+(β€œ)Γ·2),((”)+(str(y1))+(β€œ+”)+(str(y2))+(β€œ)Γ·2)”))

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

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

+(str(x5))+(β€œ.”))

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 ")

+(str(y5))+(β€œ.”))

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)+β€œ).”)