In Python, the computer needs to know what kind of information it’s working with. The two most common types are Strings (which are just text) and Integers (which are whole numbers).
A String
is anything that is text. Think of it as a string of letters, numbers, or symbols all tied together.
The Golden Rule: To tell Python that something is a string, you must wrap it in quotes. You can use single quotes ('
) or double quotes ("
).
An Integer
is a whole number (a number without a decimal point). You use integers for counting and doing math.
Notice that integers do not use quotes.
This is super important! To Python, "5"
is a text character, while 5
is a number you can do math with.