Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #7-8
- '''sandwich_orders = ['kolbasa','maslo','ikra']
- finished_sandwiches =[]
- while sandwich_orders:
- preparing_sandwich = sandwich_orders.pop()
- print('I made your ' + preparing_sandwich.title() + ' sandwich')
- finished_sandwiches.append(preparing_sandwich)
- for finished_sandwiche in finished_sandwiches:
- print(finished_sandwiche.title() + ' sandwich is finished')'''
- #7-9
- '''sandwich_orders = ['kolbasa','sosiski','maslo','sosiski','ikra','sosiski']
- finished_sandwiches =[]
- print('sosiski bol`she net ')
- while sandwich_orders:
- while 'sosiski' in sandwich_orders:
- sandwich_orders.remove('sosiski')
- preparing_sandwich = sandwich_orders.pop()
- print('I made your ' + preparing_sandwich.title() + ' sandwich')
- finished_sandwiches.append(preparing_sandwich)
- for finished_sandwiche in finished_sandwiches:
- print(finished_sandwiche.title() + ' sandwich is finished')'''
- #7-10 почти то же, что и рассматривали в главе, но добавил проверку правильности ввода
- '''import time
- responses ={}
- polling_activate = True
- while polling_activate:
- name = input("\nWhats your name :")
- response = input("\nWhat are you doing today? :")
- responses[name]=response
- repeat = input("\nWould you like to let another person respond? (yes/ no) ")
- input_check = True
- #проверка правильности ввода yes/no
- while input_check:
- if repeat !='yes' and repeat!='no':
- print('invalid value ')
- repeat = input("\nWould you like to let another person respond? (yes/ no) ")
- else:
- input_check = False
- #----------------------------------
- if repeat == 'yes':
- polling_activate = True
- if repeat == 'no':
- polling_activate = False
- print('poll Result')
- for name, response in responses.items():
- print(name, " ", response)
- time.sleep(10)'''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement