EXAM 01 STUDY GUIDE

This study guide will help give you an idea of what to expect for the exam. It is still a work in progress, and may have some changes (you will be notified via email as those changes occur). All book, quiz, plickers, notes, slides, assignments, lecture, and code example content can be inspiration for exam questions.

FORMAT:

16 total questions, 50 points

  • 12 Multiple Choice (25 pts / 50%)
  • 2 Long form answers explaining code (20 pts / 40%)
  • 1 short answer, I just need a value (4 pts / 8%)
  • 1 True / False (1 pt / 2%)

You WILL NOT NEED TO WRITE CODE for this exam, but you will need to understand it.

SUPPORTING MATERIALS

If the exam has questions related to conversions to and from decimal, binary, or hexideciamal, you will receive a powers of 2 chart to help with the conversion. You will however need to know how to properly represent hexidecimal values (0-9 and A-F).

TOPICS:

  • Variables
    • Declaration and use
    • Immutable and mutable types
  • Strings
    • Accessing characters
    • Splitting
    • Slicing
  • Numbers
    • Math operations
  • Number conversions between:
    • Decimal
    • Binary
    • Hexadecimal
  • Looping
    • For loops
      • over a collection (strings, lists, tuples)
      • using range()
    • Nested loops
  • Lists
    • Operations
      • Accessing items
      • Adding items
      • Removing items
      • Slicing
  • If statments
    • Conditions
      • Equality, comparison, logical, and membership operators
  • Input
    • Collect user input and use it as a:
      • string
      • int
      • float

Practice Problem

Write a program that prints a rectangle to the screen. The program should use the input() function to get the length and width of the rectangle from the user. With those dimensions, create the rectangle in a nested list where the edges of the rectangle are represented by the X character and empty space is the O character. Once you have each “row” created, you can simple print them

Example output rectangle for input dimensions 4 x 5.


[X, X, X, X, X]
[X, O, O, O, X]
[X, O, O ,O ,X]
[X ,X ,X ,X ,X]