用户:查看:0 回复:1 评论:0 创建时间:2021-10-31T12:11:55
【作品展示】

【作品介绍】
半成品
【作品源代码】
import turtle
light=14.6
heavy=21.8
fat=24.5
height=1.42
weight=40.5
BMI=weight/(height*height)
print(BMI)
if BMI<=light:
print("偏瘦")
elif BMI<=heavy:
print("正常")
elif BMI<=fat:
print("超重")
else:
print("肥胖")
mypen=turtle.Pen()
mypen.pensize(20)
mypen.pencolor("skyblue")
mypen.forward((light-10)*20)
mypen.pencolor("lightgreen")
mypen.forward((heavy-light)*20)
mypen.pencolor("coral")
mypen.forward((fat-heavy)*20)
mypen.pencolor("indianred")
mypen.forward((3)*20)
mypen.penup()
mypen.goto((BMI-10)*20,0)
mypen.dot(15,"gold")
mypen.hideturtle()
turtle.done()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn