1.农

print("“王者荣耀”游戏角色")
hero = ["====坦克:====","苏烈 刘邦 钟馗 张飞 牛魔 程咬金 白起 刘禅 庄周 项羽....","====战士:=====","狂铁 裴擒虎 铠 孙悟空 哪吒...","====刺客:====","百里玄策 庞统 花木兰...",
"====法师:====","杨玉环 奕星 女娲...","====射手:====","公孙离 百里守约...","====辅助:====","明世隐 梦奇..."]
for item in hero:
print(item)

 

 

 

 2.订票

station = ["车次","出发站-到达站","出发时间","到达时间","历时",
"T40","长春-北京","00:12","12:20","12:08",
"T298","长春-北京","00:06","10:50","10:44",
"Z158","长春-北京","12:48","21:06","08:18",
"Z62","长春-北京","21:58","06:08","8:20"]
for index,item in enumerate(station):
if (index+1)%5 == 0:
print(item+"\n")
else:
print(item+"\t\t",end='')
a = input("请输入要购买的车次:")
b = input("请输入乘车人(用逗号隔开):")
m = len(station)
for i in range(m):
if a == station[i]:
print("您已购" + str(a) + "次列车 " + station[i+1] +" "+ station[i+2] + "开,请" + str(b) + "尽快换取纸质车票。【铁路客服】")

 

 

 

 3.收视率

TV=[('《Give up,hold on to me》',1.4),
('《The private dishes of the husbands》',1.343),
('《My father-in-law will do martiaiarts》',0.92),
('《North Canton still believe in love》',0.862),
('《Impossible task》',0.553),
('《Sparrow》',0.411),
('《East of dream Avenue》',0.164),
('《Theprodigal son of the new frontier town》',0.259),
('《Distant distance》',0.394),
('《Music legend》',0.562),
]
TV.sort(key=lambda s:s[1], reverse=True)
for TV in TV:
print(TV[0]+"收视率:"+str(TV[1])+"%")

 

 

 

posted on 2022-09-27 19:40  sadadadadadsad  阅读(21)  评论(0编辑  收藏  举报