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

Unlock This Lesson

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

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set your subtitle preferences in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Python Basics Exercises: Numbers and Math (Summary)

Congratulations! You’ve made it through exercises and challenges to practice using the knowledge that you gained in Python Basics: Numbers and Math. Now you have a solid grasp on the math skills that will serve you as a Python programmer.

Throughout this hands-on course, you’ve reinforced your understanding of numbers and math in Python programming by tackling a series of challenging exercises and coding problems. By actively engaging with the material, you’re now ready to handle real-world scenarios with confidence.

In this course, you’ve practiced

  • Creating integers and floating-point numbers
  • Utilizing advanced techniques such as arithmetic expressions, math functions, and number methods
  • Skillfully incorporating number formatting and display within strings
  • Acquiring proficiency in handling user input for numbers

You’ve also learned some general best practices that will serve you in any coding challenge that comes your way.

To expand your knowledge, you can check out these tutorials:

You’ll also enjoy the following video courses:

Now that you’ve added numbers and math to your programming tool kit, you can continue on your Python Basics journey through the learning path or the book.


Sample Code (.zip)

3.4 KB

Course Slides (.pdf)

9.8 MB

00:00 Congratulations on reaching the end of this Python Basics Exercises course. You’ve completed a total of ten exercises that tested your knowledge of working with numbers in Python. More specifically, you’ve practiced using integer and floating-point literals to define numbers in Python; the format specification mini-language to control how numbers are displayed; numbers supplied by the user, which require a type conversion to be processed correctly; and finally, math functions and number methods to perform calculations.

00:34 Along the way, you picked up a few useful tips that may help you tackle exercises like these in the future or solve actual programming problems that you might come across at work.

00:45 It’s always a good idea to read the instructions carefully to make sure that you understand the problem correctly. Apply the divide-and-conquer principle to break a big problem into smaller tasks that are more manageable and easier to solve.

00:59 Take your time to think through the problem and come up with a plan before writing any code. It can spare you from implementing something that you wouldn’t need at all.

01:08 When writing code, take small steps to help you focus on one little task at a time. Keep your code clean and easy to follow by giving variables descriptive and meaningful names.

01:20 It will help you and others understand the code more quickly. Occasionally, you can use comments to explain difficult or surprising fragments of code. Try to explain why rather than the what. Last but not least, validate each step as you go. In the long run, this approach can reduce the time you’ll spend debugging your code when it stops working as expected. Before closing this course, have a look at a few additional resources available on Real Python, which you can check out as a follow-up to learn even more about working with numbers in Python.

01:56 Bear in mind that some of these are advanced tutorials that may require a bit more Python experience before diving in. As always, the slides for this course are available for download in the supporting material dropdown below this video.

02:11 You can find this page and click the links to open any research that you might find interesting. Again, congratulations and thank you for joining me in this course.

Become a Member to join the conversation.