Skip to main content
SciNet
  • Home
  • All Courses
  • Calendar
  • Certificates
  • SciNet
    Main Site Documentation my.SciNet
  • CCDB
  • More
Close
Toggle search input
English
English Français
You are currently using guest access
Log in
SciNet
Home All Courses Calendar Certificates SciNet Collapse Expand
Main Site Documentation my.SciNet
CCDB
Expand all Collapse all
  1. Dashboard
  2. BCH2203 - Winter 2022
  3. 1. Survey Analysis

1. Survey Analysis

Completion requirements
Opened: Wednesday, 19 January 2022, 12:00 AM
Due: Wednesday, 26 January 2022, 11:59 PM

You are given the results of a survey which contained ten yes-or-no questions.

The results are stored in a text file called `2022-01-19_survey-results.txt`, of which each line contains one survey entry.

Each survey entry is a string of 10 characters, which can be either 'Y' or 'N'  (the first character is the answer to the first question, the second character the answer to the second, etc.)

Your task is write a python script called `survey_analysis.py` to analyze the data.

In particular:

  • Your script should read the file `2022-01-19_survey-results.txt` into a list.
  • For each of the ten questions, it should print the percentage of 'N' and 'Y' answers.
  • It should also print the number of surveys with zero 'Y' answers, then the number of surveys with one 'Y' answer, with two 'Y' answers, ... , and with ten 'Y' answers.

Your script should be submitted to the course site by January 26, 2022, at midnight.

Note: On the teach cluster, you can get the data file with the command


  • 2022-01-19_survey-results.txt 2022-01-19_survey-results.txt
    19 January 2022, 10:28 AM
Contact site support
You are currently using guest access (Log in)
Data retention summary


All content on this website is made available under the Creative Commons Attribution 4.0 International licence, with the exception of all videos which are released under the Creative Commons Attribution-NoDerivatives 4.0 International licence.
Powered by Moodle