Module 1
Numbers
Numbers are not strings.
Not everything needs quotes
Numbers are a different type of data from strings. A number like 42 is a whole number. A number like 3.14 is a decimal.
PythonA whole number, no quotes.
print(42)
→ 42
PythonThe same digits, but as a string. Notice the quotes.
print("42")→ 42
Why it matters
A number and a string that look the same are different inside the computer. You can do math with numbers, but not with text.
Two kinds of data
Step 1
Step 2
Numbers let you do math. Strings are just text.
Your task
Print a number
- Print the number 42. It is a number, not a string, so no quotes.
Remember
Whole numbers (int) and decimals (float) are different from strings (str). Quotes make something a string.