Description
Problem 1: In the beginning. . .
This “toy” problem set has only one problem: fill out a pre-course survey, in the form of a short Python
programming assignment and a follow-up reflection. This problem is structured to give you an initial exposure
to the plan → develop → apply → reflect cycle, as well as to familiarize you with submitting to Gradescope
and the autograder.
Problem Set 0 4
When you are done, you should submit the following files to Gradescope before the submission deadline.
List of files to submit:
1. README.problem1.[txt/pdf]
2. survey.py
3. FLAG.txt
Successful on-time completion of PS0 will amount to 2% of your final course grade. Unlike future problem
sets (of which there are seven, each worth 13% of your course grade), PS0 is graded all-or-nothing.
Plan
You will ultimately be answering the following four questions within README.problem1.txt. The answers to
the first three questions must be reported by your code, meaning that you will copy the (human-readable)
output of your code into your README in order to answer them. When that’s done, you will add your response
to the fourth question to your README as a reflection.
• What is the highest Duke COMPSCI course number you have taken? This should be an integer, like
101, 201, 230, 250, etc. If this is your first Duke COMPSCI course, please answer 0.
• On a scale of 0-3, how much programming experience have you had in Python? Here’s how to interpret
the scale:
0 = I have not used Python before, but can confidently program in another language.
1 = I have used Python in one context (like COMPSCI 101) but have little other experience.
2 = I have programmed in Python in multiple contexts.
3 = I’m a Python ninja.
• What Python editor will you be using this semester? (Most likely answer will be PyCharm.)
• Why are you taking this class? What are you hoping to gain by taking it? How will you achieve your
goals for this class?
Develop
a) Within survey.py, write a function called make survey response dict that takes as input three parameters and returns a dictionary with those values respectively assigned to three keys: course, python,
and editor. If you call this function with your answers to the first three questions above (an integer, an
integer in the set {0, 1, 2, 3}, and a string), the returned dictionary should look something like this:
{
’course’: 101,
’python’: 1,
’editor’: “PyCharm”
}
Problem Set 0 5
Apply
b) Report your answers to the first three survey questions.
[Just to be clear, this means that the code you write in the run survey response function should start
by calling the make survey response dict function with your first three answers as parameter values, and
then it should take the resulting dictionary and use it to print human-readable sentences to the console (it
will also return the dictionary). As always, you should copy this console output into your README to show
how your code reports its results to a human user. This is just a toy example, but reflects what we mean
when we ask you to report something throughout the semester.]
Reflect
c) Why are you taking this class? What are you hoping to gain by taking it? How will you achieve your
goals for this class?
[Just to be clear, this means you should write a response to this open-ended question into your README;
it need not be generated by your code. Your READMEs will generally contain your written answers, ideas,
thoughts, or reflections, interleaved with any human-readable output reported by your code.]

