karen_constantine

Untitled

Aug 16th, 2023
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. interview = {}
  2. active = True
  3. while active:
  4. name = input('Как вас зовут?\n')
  5. question = input('Какая марка автомобиля вам нравится?\n')
  6. answers = []
  7. answers.append(question)
  8. interview[name] = answers
  9. active_2 = True
  10. while active_2:
  11. repeat = input('Желаете добавить еще один автомобиль? (yes/no)\n')
  12. if repeat == 'no':
  13. active_2 = False
  14. else:
  15. question_n = input('Какая марка автомобиля вам еще нравится?\n')
  16. answers.append(question_n)
  17. repeat = input('Желаете продолжить опрос? (yes/no)\n')
  18. if repeat == 'no':
  19. active = False
  20. print('Опрос завершен, все результаты: ')
  21. for name, questions in interview.items():
  22. print(f'{name.title()} любит автомобили марки: ')
  23. for question in questions:
  24. print(f'{question.title()}')
Add Comment
Please, Sign In to add comment