Skip to content

Jan 29: Data types

Overview

  • Review homework 1
  • Discuss data types and string formatting
  • Video on how to interpret gradescope output

Homework 1

  • Your grades will be copied over from gradescope to Canvas after everyone is finished
  • Be sure to do the Reflection task for HW1
  • If you believe that gradescope graded you unfairly or incorrectly, please let me know as soon as possible.

Homework highlights:

  • Convert user input to an int or float if you need to do math on it

    val = int(input())

  • Exponent operator:

    two_cubed = 2 ** 3

  • A string s multiplied by an integer x makes x copies of the string

    val = 'z' * 5 # val will be 'zzzzz'

Data types and string formatting

Material from the early sections of chapter 2.

Strings and Expressions (Chap 2)

Helpful Video

Please watch this 10-minute video recorded by Dr. Sprague in Spring 2022. The video explains how to interpret the (often confusing) feedback on Gradescope. The video also walks through an in-class exercise that you might see next week.