Learn Python 010: Dictionary - Cinema Simulator
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Learn Python 010: Dictionary - Cinema Simulator相关的知识,希望对你有一定的参考价值。
films = { ‘Finding Dory‘: [3, 5], ‘Bourne‘: [18, 7], ‘Tarzen‘: [15, 9], ‘Ghost Busters‘: [12, 5] } while True: choice = input(‘Please enter the selected film: ‘).title().strip() if choice in films: age = int(input(‘Please enter your age: ‘).strip()) if age >= films[choice][0]: if films[choice][1] > 0: print(‘Enjoy.‘) films[choice][1] = films[choice][1] - 1 else: print(‘Sorry, we are sold out.‘) else: print("Sorry, you are too young to watch the film.") else: print(‘Sorry, we do not have this film.‘)
以上是关于Learn Python 010: Dictionary - Cinema Simulator的主要内容,如果未能解决你的问题,请参考以下文章
[Python]?????????Python?????????010???(????????????????????????????????????)????????????????????????