What can I store in a variable?


#1

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)


FAQ: Learn Python - Python Syntax - Variables
#3

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