Commit 060d0edb by BellCodeEditor

auto save

parent eb2dbbaa
Showing with 148 additions and 18 deletions
# 报菜名 # import turtle
# 悟空和诺依到了一家特色餐馆,这家餐馆最大的特色就是有个自动报菜名机器人 # p=turtle.Pen()
# 通常它会自动说出今天的前菜有哪些汤有哪些主菜有哪些等等~ # p.penup()
# 可是今儿它有些bug产生的结果很奇怪,你可以检查出来么? # p.goto(-100,-100)
today_menu={'前菜':{'熏鲢鱼':20,'生蚝':20,'面包':10}, # p.pendown()
'汤':{'玉米浓汤':15,'蔬菜汤':15,'海鲜汤':15}, # p.speed(1)
'主菜':{'鱼':40,'虾':30,'蟹':20,'贝壳类':20}, # for i in range(4):
'间菜':{'牛扒':25,'煨菜':25,'肉排':30}, # p.forward(200)
"烧烤和沙拉":{'需要':15,'不需要':0}, # p.left(90)
'甜品':{'可丽露':20,'优格吐司':15,'蓝莓松饼':20} # p.penup()
} # p.goto(-100,0)
# p.pendown()
for k,v in today_menu.items(): # p.fillcolor("red")
print('今日' + k + '有:') # p.begin_fill()
for i in v: # p.goto(0,-100)
print(i,end=' ') #依次告诉客人今天的各类菜有哪些选择 # p.goto(100,0)
print() # p.goto(0,100)
\ No newline at end of file # p.end_fill()
# p.hideturtle()
# turtle.done()
# a=input("请输入长:")
# b=input("请输入宽:")
# a=int(a)
# b=int(b)
# c=2*(a+b)
# d=a*b
# print("这个长方形的周长是"+str(c)+",面积是"+str(d))
# import turtle
# p=turtle.Pen()
# p.penup()
# #左上
# p.goto(-100,0)
# p.pendown()
# p.fillcolor("black")
# p.begin_fill()
# for i in range(4):
# p.forward(100)
# p.left(90)
# p.end_fill()
# p.penup()
# #右上
# p.goto(0,0)
# p.pendown()
# for i in range(4):
# p.forward(100)
# p.left(90)
# p.penup()
# #左下
# p.goto(-100,-100)
# p.pendown()
# for i in range(4):
# p.forward(100)
# p.left(90)
# #右下
# p.penup()
# p.goto(0,-100)
# p.pendown()
# p.fillcolor("black")
# p.begin_fill()
# for i in range(4):
# p.forward(100)
# p.left(90)
# p.end_fill()
# p.hideturtle()
# turtle.done()
# import turtle
# p=turtle.Pen()
# p.penup()
# p.goto(-100,100)
# p.pendown()
# for i in range(4):
# p.forward(200)
# p.right(90)
# p.penup()
# p.goto(0,-50)
# p.pendown()
# p.fillcolor("blue")
# p.begin_fill()
# p.circle(50)
# p.end_fill()
# turtle.done()
# import turtle
# p=turtle.Pen()
# p.speed(1)
# p.penup()
# p.goto(90,90)
# p.pendown()
# p.pencolor('black')
# p.fillcolor('yellow')
# p.begin_fill()
# p.goto(-90,90)
# p.goto(-90,-90)
# p.goto(90,90)
# p.end_fill()
# p.penup()
# p.fillcolor('red')
# p.begin_fill()
# p.pendown()
# p.goto(90,-90)
# p.goto(-90,-90)
# p.goto(90,90)
# p.end_fill()
# turtle.done()
# 计算长方形的面积,并输出结果
a=6
# 将长方形的长:6,赋值给a
b=3
# 将长方形的宽:3,赋值给b
s=a*b
# 长方形面积计算公式为:面积=长*宽
print("长方形的面积为"+str(s))
# 控制台输出长方形面积
with open(r'c:\Users\my\Desktop\text.txt','a',encoding='utf-8') as file:
#file.write('小兰:12本')
#a = file1.read()
#print(a)
for data in file1:
if '小强:10本' in data:
print('数据在文件中')
\ No newline at end of file
try:
age=int(input("你今年几岁了?"))
except:
print("要输入整数")
print("程序结束")
\ 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