Companies Home Search Profile

Python Modulo: Using the % Operator

Focused View

Christopher Trudeau

33:55

173 View
  • 01 Mod intro.mp4
    01:44
  • 02 Mod modarth.mp4
    03:35
  • 03 Mod per.mp4
    07:00
  • 04 Mod usage.mp4
    08:56
  • 05 Mod class.mp4
    09:00
  • 06 Mod sum.mp4
    03:40
  • modulo sample code.zip
  • modulo slides.pdf
  • Description


    Python supports a wide range of arithmetic operators that you can use when working with numbers in your code. One of these operators is the modulo operator (%), which returns the remainder of dividing two numbers. Modular operations are useful to check if a number is even or odd, simplifying cycling through data, and doing non-decimal based units conversion.

    In this course, you’ll learn:

    The code in this course was tested with Python 3.9.0, % has not change much and older versions should be compatible.

    What You'll Learn?


    • How modulo works in mathematics
    • How to use the Python modulo operator with different numeric types
    • How Python calculates the results of a modulo operation
    • How to override .__mod__() in your classes to use them with the modulo operator
    • How to use the Python modulo operator to solve real-world problems

    More details


    User Reviews
    Rating
    0
    0
    0
    0
    0
    average 0
    Total votes0
    Focused display
    Category
    Christopher Trudeau
    Christopher Trudeau
    Instructor's Courses

    Christopher has a passion for the Python language and writes for Real Python. He is a consultant who helps advise organizations on how to improve their technical teams. Christopher is a strong advocate for automation throughout the delivery process and the power of small teams with well defined goals.

    You can find Christopher here:

    Learn Python online: Python tutorials for developers of all skill levels, Python books and courses, Python news, code examples, articles, and more.
    • language english
    • Training sessions 6
    • duration 33:55
    • Release Date 2023/01/05