What can I store in a variable?

Question

We’ve stored numbers and strings in variables so far, what else can Python store in a variable?

Answer

Python variables can store:

  1. Characters (single characters, like ‘c’)

  2. Strings (“sentences wrapped in quotation marks, like this one”)

  3. Numbers (integers and floating point numbers)

  4. Booleans (True or False)

  5. Data structures (lists, tuples, dictionaries - you’ll learn about these later)

9 Likes

2 posts were split to a new topic: Why Can’t I Store a Number Starting with 0?