Commit 2476deb3 by BellCodeEditor

save project

parent 0b11e37c
total = []
s1={"数学":100,"语文":100}
s2={"数学":130,"语文":170}
s3={"数学":109,"语文":122}
scores={"小明":s1,"小王":s2,"小李":s3}
while True:
unit=input("请输入: ")
if unit== 'q':
print("退出请按p")
a=input("名字:")
if a=="p":
break
else:
total.append(unit)
print(total)
if a in scores:
s=""
for m , n in scores[a].items():
s=s+m+str(n)+" "
print(a+"你的成绩:"+s)
\ No newline at end of file
def new():
z=[]
while True:
a=input("输入价格 ")
if a=="stop":
break
else:
try:
al=int(a)
except:
print("输入数字")
else:
z.append(al)
print(z)
new()
dict_hero={'侯三':10,'后裔':21,'后于':21}
a=input('你要什么?')
if a in dict_hero:
print('你点的'+a+'须要'+str(dict_hero[a])+'元')
else:
print('没有')
\ No newline at end of file
i=3
user="6"
mima="1111"
while True:
if i>0:
user1=input("用户名")
mima1=input("密码")
i=i-1
if user1==user and mima1==mima:
print("登录成功")
break
elif user1!=user:
print("用户名错误")
print("还有"+str(i)+"机会")
else:
mima1!=mima
print("密码错误")
print("还有"+str(i)+"机会")
if i==0:
print("账户冻结")
print("欢迎登录")
\ No newline at end of file
for m in range(1,10):
for n in range(1,10):
print(m,"*",n,"=",(m*n),sep=" ",end=" ")
print()
            '汤':{'玉米浓汤':15,'蔬菜汤':15,'海鲜汤':15},
            '主菜':{'鱼':40,'虾':30,'蟹':20,'贝壳类':20},
            '间菜':{'牛扒':25,'煨菜':25,'肉排':30},
            "烧烤沙拉":{'需要':15,'不需要':0},
            '甜品':{'可丽露':20,'优格吐司':15,'蓝莓松饼':20}
            }
for k,v in today_menu.items():  
    print('今日' + k + '有:')
    for i in v:               
        print(i,end=' ')      #依次告诉客人今天的各类菜有哪些选择
    print()
\ No newline at end of file
for m in range(1,10):
for n in range(1,m+1):
print(m,"*",n,"=",m*n,sep=" ",end=" ")
print()
\ No newline at end of file
file=open(r'C:\Users\makcoo\Desktop\test.txt','w',encoding='utf-8')
file.write('f')
file.close()
file=open(r'C:\Users\makcoo\Desktop\test.txt','r',encoding='utf-8')
p=file.read()
print(p)
file.close()
\ 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