调试程序1
import turtle import time r=10 h=90 for i in range(4): turtle.circle(r,h) turtle.circle(-10, 90) time.sleep(2) #turtle.circle(40,120) #turtle.circle(-40,80)
调试程序2
import turtle import time turtle.setup(650,350,200,200) turtle.penup() turtle.fd(-250) turtle.pendown() turtle.pensize(25) turtle.pencolor(“purple”) turtle.seth(-40) time.sleep(5) for i in range(4): turtle.circle(40,80) turtle.circle(-40,80) turtle.circle(40,80/2) turtle.fd(40) turtle.circle(16,180) turtle.fd(40*2/3)
调试程序3
tempstr=input(“请输入带有符号的温度值:”) if tempstr[-1] in [‘F’,‘f’]: c=(eval(tempstr[0:-1])-32)/1.8 print(“转换后的温度是{:.2f}C”.format?) elif tempstr[-1] in [‘C’,‘c’]: f=1.8*eval(tempstr[0:-1])+32 print(“转换后的温度是{:.2f}F”.format(f)) else: print(“输入带有符号的温度值格式错误”)
|