Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Python Basics: Numbers and Math (Summary)

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.

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:

To continue your Python learning journey, check out the Python Basics learning path.

Download

Course Slides (.pdf)

8.2 MB

Become a Member to join the conversation.