Introduction to Data Types

While programming, you will be storing and manipulating lots of data. But where does it all go?

Data is stored in something called a variable. When creating a variable, you give it a name and then tell it what will be stored in it. Like this:

favorite_number = 12

You will encounter several different data types. The 3 most common types are integers, floats, and strings.

Integers are whole numbers like 12.

Floats are decimal point numbers like 12.0.

Strings are text like howdy or My favorite number is 12. Note you can use numbers inside strings.

You will use these a lot, so take the time to do the reading below to make sure you are comfortable with them. :)

Reading material

  • Chapter 1 from Automate the Boring Stuff with Python
  • Basics from A Byte of Python

Optional Readings:
Variables, expressions and statements from How to Think Like a Computer Scientist
* Accompanying video
Data Types on Wikibooks