Number guessing game and drawing

guessing game:

while True:
a = int(input('Please guess my height (unit: cm)\n'))
if a>200:
print('Sorry, your guess is too big, please re-enter')
elif a<200:
print('Sorry, your guess is too small, please re-enter')
else:
a=200
print('Congratulations on your guess')
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()

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325164527&siteId=291194637