Нет описания

language_survey.py 547B

12345678910111213141516171819
  1. from survey import AnonymousSurvey
  2. # Define a question, and make a survey object.
  3. question = "What language did you first learn to speak?"
  4. my_survey = AnonymousSurvey(question)
  5. # Show the question, and store responses to the question.
  6. my_survey.show_question()
  7. print("Enter 'q' at any time to quit.\n")
  8. while True:
  9. response = input("Language: ")
  10. if response == 'q':
  11. break
  12. my_survey.store_response(response)
  13. # Show the survey results.
  14. print("\nThank you to everyone who participated in the survey!")
  15. my_survey.show_results()