In-Class Questions and Video Solutions

Lecture 1

  1. Shell vs. Editor

    You run the code below from the editor.

    `type(5)`
    `print(3.0-1)`
    

    What’s printed?

     int  close
     2.0  check
     int then 2.0  close
     nothing  close
    Check Show Solution

  2. Python vs. Math

    Which is allowed in Python?

     x + y = 2  close
     x\*x = 2  close
     2 = x  close
     xy = 2  check
     None of the Above  close
    Check Show Solution

  3. Bindings

    You run the code below from the file editor.

    `usa_gold = 46`
    `uk_gold = 27`
    `romania_gold = 1`
    
    `total_gold = usa_gold + uk_gold + romania_gold`
    `print(total_gold)`
    
    `romania_gold += 1`
    `print(total_gold)`
    

    What’s printed?

     74 then 74  check
     74 then 75  close
     74  close
     75  close
    Check Show Solution

Course Info

Learning Resource Types

assignment Problem Sets
notes Lecture Notes
theaters Lecture Videos
assignment_turned_in Programming Assignments with Examples