展开全部
import turtle, math
def pic(x0, y0, x1, y1):
dis = int(math.sqrt((x0 - x1) ** 2 + (y0 - y1) ** 2))
turtle.hideturtle()
turtle.up()
turtle.goto(x0, y0)
turtle.down()
turtle.goto(x1, y1)
turtle.left(math.atan2(y1 - y0, x1 - x0) / math.pi * 180)
turtle.up()
turtle.backward(dis / 2)
turtle.write('长度为:%s' % dis, align='left')
turtle.done()
def palin():
k = []
total = []
for i in range(10, 200000):
while i > 0:
k.append(i % 10)
i = i // 10
for m in range(len(k) // 2):
if k[m] != k[len(k) - m - 1]:
break
else:
print(k)
total.append(k)
k = []
print(len(total))
if __name__ == '__main__':
x0 = int(input('输入A的横坐标:'))
y0 = int(input('输入A的纵坐标:'))
x1 = int(input('输入B的横坐标:'))
y1 = int(input('输入B的纵坐标:'))
pic(x0, y0, x1, y1)
palin()
我把这两个放在一个32313133353236313431303231363533e4b893e5b19e31333431353262主函数里运行了