Test 1 Review Guide

Test date: Wednesday, February 24, 2016
Test location: normal lecture hall (you MUST go to your assigned section)
Test duration: 50 minutes (for 1110 and 1111)
Test format: writing on paper; bring pen/pencil (and nothing else)
Review session: Tuesday, February 23, 5:00-6:00 PM in Chem 402 (TA Office Hours are canceled during the review session)

Review Sheet

General Points:

  • There will be several coding questions; problem solving will be involved.
  • One coding question will be a “big” coding question, along the lines of a simple POTD.
  • Other coding questions will ask for a couple lines of code, such as an if else statement.
  • You should be able to read code and interpret what it is doing.
  • There will be a mix of other types of questions: multiple choice, short answer, fill-in-the-blank, etc.

Not on the test:

  • Drawing with the turtle will not be on the test
  • You do not have to know what to import to get access to various things (we will provide this for you)

CS in General:

  • Where do we see computers in the world?
  • What is ambiguity? What has that got to do with CS?
  • Why is it important for people to have a basic understanding of computing?

Primitives and Types:

  • Know the basic primitive types (int, float, bool, str)
  • Know the basic mutable collection types (list and dictionary)
  • Know how casting works (i.e., how to turn a str into an int)
  • Know the operators, including %, +=, /, //, and the various comparison and boolean operators (!=, not, or, and)
  • Know how to declare a variable and change what is inside it
  • Know how to get a random integer
  • Know how to get input from the user
  • Know the basic methods for use with lists and dictionaries
  • Know how to split a string into a list
  • Know how to access items in a list or dictionary

Decision structures:

  • Know how to write if, if-elif, and if-elif-else statements
  • Know how to interpret code that uses if, if-elif, and if-elif-else statements, including ifs inside of other ifs
  • Know how scope works: a variable declared inside an if cannot be seen if that if statement never executes


  • Know how to write while loops - checking for a condition and also for verifying user input
  • Know how to write for loops - both using range() and over a list

Study Hints

Practice problems

Here are some problems you can practice with (however, we do not have the solutions available - you can probably Google for them):

  • Chapter 3 (p. 116): 5, 8, 9, 12, 13, 14
  • Chapter 4 (p. 161): 1, 2, 8, 11, 12
  • Chapter 7 (p. 334): 1, 2, 4, 6

Practice coding on paper

You’ll be writing code on paper. This feels different than writing it in PyCharm. You don’t want to be surprised by how different it feels. Practice writing code by hand.

A few small syntax errors is OK. But if you are really off we will take off points. Try to write correct code.

We’ll give you any imports you might need - so don’t worry about memorizing those.

Try re-solving the POTD and Lab problems on paper without looking at your code or textbook.

You can find more sample problems in Programming Challenges in the textbook. We do not, however, have the answer key to share with you.

Also remember that speed matters. 50 minutes is not a long time.

Practice reading code

We will show you code and ask you what it does. Practice thinking through code without running it.

Review the Lectures

Not everything in the book is equally important. Review the lecture notes to see what we emphasized. If you are confused by some point, check the audio. You might want to listen to the audio of the other instructor (the one you didn’t hear in class) so that you can get a different perspective on the material.