from survey import AnonymousSurvey #Define a question and make a survey question = "What is your favourite programming language? " my_survey = AnonymousSurvey(question) #Show the question and show the responses to the question print(my_survey.show_questions()) print("To quit enter q ") while True: inp = input("Enter your response:") if inp == 'q': break my_survey.store_response(inp) #Show the survey results print( "\n Thank you for your for your response in the survey \n Here are the results" ) my_survey.show_results()
# -*- coding:utf-8 -*- # Filename: language_survey.py # Author: Lizi # Time: 2019/12/22 11:10 from survey import AnonymousSurvey question = "What language did you first learn to speak?" my_survey = AnonymousSurvey(question) my_survey.show_questions() while True: response = input("Language: ") if response == 'q': break my_survey.show_responses(response) my_survey.show_result()