A data type tells Python what kind of value it is using.
A value can be a whole number, a decimal number, text, or a true/false value. Python uses its data type to decide how that value behaves.
age = 25 # int
price = 19.5 # float
name = "Sloby" # str
is_ready = True # boolint is a whole number, float has a decimal part, str is text, and bool is either True or False.
type(age) # <class 'int'>The type belongs to the value. A variable can later refer to a value with a different type.
Quotation marks matter: Writing 25 creates a number. Writing "25" creates text, even though the characters look the same.
age = 25
text_age = "25"age is a number, while text_age is text because it has quotation marks.
print(type(25))
print(type("25"))The type() function lets you ask Python what kind of value it sees.
print(2 + 3)
print("2" + "3")With numbers, + adds. With two strings, + joins text together.
