首页 > 其他 > 详细

2019年12月29日 MRKJ page125 实战

时间:2019-12-29 20:38:23      阅读:85      评论:0      收藏:0      [点我收藏+]
checi=[‘T40‘,‘T298‘,‘Z158‘]
dizhi=[‘cj‘,‘bj‘,‘sh‘]
atime=[‘2h‘,‘1h‘,‘3h‘]
c1=dict(zip(checi,dizhi))
print(c1)
a1=dict(zip(checi,atime))
print(a1)
print(‘checi‘,‘\t‘,‘dizhi‘,‘\t‘,‘atime‘)
for i in checi:
    print(i,‘\t‘,c1[i],‘\t‘,a1[i])#注意\t的用法和效果
cc=input(‘you buy the checi:‘)
print(‘sorry‘ if cc not in checi else ‘‘)
people=input(‘your name:‘)
print(‘you buy zhe‘+c1[cc]+‘,‘+people+‘ please take the ticket‘)

 》》》》

{‘T40‘: ‘cj‘, ‘T298‘: ‘bj‘, ‘Z158‘: ‘sh‘}
{‘T40‘: ‘2h‘, ‘T298‘: ‘1h‘, ‘Z158‘: ‘3h‘}
checi dizhi atime
T40 cj 2h
T298 bj 1h
Z158 sh 3h
you buy the checi:T40

your name:SXJ
you buy zhecj,SXJ please take the ticket

2019年12月29日 MRKJ page125 实战

原文:https://www.cnblogs.com/python1988/p/12116082.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!