运算猜数字游戏以及画图
猜谜游戏:
while True:
a = int(input('请猜测我的身高(单位:cm)\n'))
if a>200:
print('对不起,您猜大了,请重新输入')
elif a<200:
print('对不起,您猜小了,请重新输入')
else:
a=200
print('恭喜您猜对了')
break

画图:
import turtle #引用turtle库
scr = turtle.Screen()
t = turtle.Pen()
t.shape("turtle")
scr.bgcolor("white")
t.pensize(2)
t.color("black")
for n in range(30):
t.fd(n*10)
t.lt(90)
scr.exitonclick()

转载于:https://www.cnblogs.com/Minwon/p/8982646.html
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
