So far, we've seen different kinds of data
num_students = 42 #whole numbers
avg_gas_estimate = 2.70 #numbers with decimal
print("Hello world!") #text data
All data has a type which defines what kind of thing it is and what you can do with it.
integer: whole numbers
floating point: numbers with decimal points
string: text data
The type() function can be used to tell you what kind of type something is.
Both values and variables can have types.
type(2.70)
type(avg_gas_estimate)
type("Hello world")
type(num_students)
We've seen how arithmetic operators work on numerical types like ints and floats.
Strings have their own operators too - and some look like arithmetic operators!
greeting = "Hello"
name = "Eric"
greeting+name
greeting-name #not allowed
Similarly, you can't do everything with numbers that you can with strings.
len(name)
len(num_students)
There are several other built-in types that we'll hear more about later like
Boolean: can have value True or False
List: for keeping track of a sequence of values
type(False)
type([1,2,3])
You can even make your own types or use those that others have created.