Great! We can now summon the value 10
by calling out the name my_variable
whenever we need it.
In this case, the data type of my_variable
is an integer (a positive or negative whole number). There are three data types in Python that are of interest to us at the moment: integers, floats (fractional numbers written with a decimal point, like1.970
), and booleans (which can beTrue
or False
).
Computer programs, in large part, are created to manipulate data. Therefore, it's important to understand the different types of data (or "datatypes") that we can incorporate into our programs.
Never use quotation marks ('
or "
) with booleans, and always capitalize the first letter! Python is case-sensitive (it cares about capitalization). We'll use quotation marks when we get to strings, which we'll cover in the next unit.