Commit 962abedd by BellCodeEditor

auto save

parent eb2dbbaa
Showing with 26 additions and 2 deletions
......@@ -12,6 +12,6 @@ today_menu={'前菜':{'熏鲢鱼':20,'生蚝':20,'面包':10},
for k,v in today_menu.items():
print('今日' + k + '有:')
for i in v:
print(i,end=' ') #依次告诉客人今天的各类菜有哪些选择
for i,j in v.items():
print(i,j,end=' ') #依次告诉客人今天的各类菜有哪些选择
print()
\ No newline at end of file
import turtle #导入turtle模块
turtle.shape('turtle') #设置画笔形状为海龟
turtle.color('red') #设置画笔颜色为红色
turtle.setheading(90)
def up():
turtle.fd(10) #画笔移动10
def down():
turtle.bk(10) #画笔后退10
def left():
turtle.left(5) #画笔左转90度
def right():
turtle.right(5) #画笔右转90度
turtle.onkeypress(up,'Up')
turtle.onkeypress(down,'Down')
turtle.onkeypress(left,'Left')
turtle.onkeypress(right,'Right')
turtle.listen()
turtle.mainloop() #循环监听 等同于turtle.done()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment