Review

Key Ideas

  • A name refers to a value.
  • Assignment updates what a name refers to.
  • Reassignment affects later lines, not earlier output.
  • Integers and floats are numeric values.
  • Strings store text.
  • Booleans are True and False.
  • None represents no meaningful value yet.
  • Expressions produce values.
  • Statements do work.
  • type() inspects what kind of value Python has.

Key Syntax

SyntaxMeaning
score = 8assign a value to a name
print(score)print the value referred to by score
"hello"string value
Trueboolean true
Falseboolean false
Noneintentional absence of a value
2 ** 3power
type(value)inspect the value's type

Common Mistakes

MistakeFix
Reading assignment as permanent equalityread assignment as an action
Using a name before assignmentassign the name first
Confusing "8" and 8inspect with type()
Using ^ for powersuse **
Writing true or falseuse True and False
Expecting assignment to printuse print()

Checklist

You are ready to move on if you can:

  • predict the final value after reassignment
  • compute small arithmetic expressions
  • join strings intentionally
  • explain why "4" + "5" gives "45"
  • recognize booleans and None
  • separate the right-side expression from the whole assignment statement
  • use type() to debug a surprising value

If You Feel Lost

Return to this tiny program:

Then change "8" to 8 and rerun. Watch both the output and the type.