Section 2 Overview
Numbers and text are not the same thing — and Python is strict about it.
Add two numbers and you get math. Add two strings and you get words glued together. Try to mix them without converting first and Python throws an error in your face.
In this section you'll learn exactly how Python thinks about data, and how to bend it to do what you actually want.
What you'll cover
- Numbers in Python — integers, floats, and how arithmetic works
- Text in Python — strings,
len(), and how to measure and manipulate them - When types collide — what happens when you mix numbers and text (and how to fix it)
- Mix numbers and text — joining pieces together into output that actually means something
By the end of this section
You'll be able to take raw numbers and text, combine them, reformat them, and print exactly what you want. That's not a toy skill — it's in every Python program ever written.
Click Next and let's get into it.
No comments yet. Add the first comment to start the discussion.