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 +
, -
,
*
, /
, and %
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.