python2.x绘图+字符串加法

#coding=utf-8

x1,y1 = eval(raw_input("请输入第一个点的坐标:"))
x2,y2 = eval(raw_input("请输入第二个点的坐标:"))

import turtle
turtle.penup()
turtle.write("(" + str(x1) + "," + str(y1) + ")")
turtle.goto(x1,y1)
turtle.pendown()
turtle.goto(x2,y2)
turtle.write("(" + str(x2) + "," + str(y2) + ")")
turtle.goto((x1+x2)/2.0,(y1+y2)/2.0)
len = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
turtle.write(len)
turtle.done()
python2.x绘图+字符串加法_第1张图片

你可能感兴趣的:(python)