In this video course, you learned all about working with numbers in Python. You saw that there are two basic types of numbers—–integers and floating-point numbers–—and that Python also has built-in support for complex numbers.
First, you saw how to do basic arithmetic with numbers using the
% operators. You learned how to write arithmetic expressions
and the best practices in PEP 8 for formatting arithmetic expressions
in your code.
Then you learned about floating-point numbers and how they may not always be 100 percent accurate. This limitation has nothing to do with Python. It’s a fact of modern-day computing related to the way that floating-point numbers are stored in a computer’s memory.
Next, you saw how to round numbers to a given decimal place with
round() and learned that
round() rounds ties to even, which is different
from the way most people learned to round numbers in school. You
also saw numerous ways to format numbers for display.
Finally, you learned about Python’s built-in support for complex numbers.
Now it’s time to reinforce what you’ve learned. Hop over to Python Basics Exercises: Numbers and Math to practice your skills by solving coding challenges.
For more information on the concepts in this video course, check out:
- Numbers in Python
- How to Round Numbers in Python
- Representing Rational Numbers With Python Fractions
- Format String Syntax - Python documentation
- Simplify Complex Numbers With Python
To continue your Python learning journey, check out the Python Basics learning path.
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.