Integer - (Modulo|Modulus)

Data System Architecture

About

Modulo returns the remainder left over by integer division.

5 % 2 = 1

because 2 goes into 5 evenly two times, with 1 left over.

10 % 5 = 0
113 % 100 = 13

Example

Is even

Is an integer even ?

if (MyVariable % 2 == 0):
    print "Even"
else:
    print "Odd"





Discover More
Data System Architecture
Integer - Division

An Integer Division gives the integer quotient as: Modulo returns the remainder left over by integer division. Division...
Data System Architecture
Number - (Arithmetical | Numerical | Mathematical) Operators

Number operators Addition (+) Addition in an compound assignment form += Subtraction (-) Division (/) Python: Multiplication () Truncating integer division (//) ...
Data System Architecture
Number - Integer -

An integer is the part of a number that is located at the left of the radix point. In other word, it's a number without its fractional component. Negative numbers without fractional components are...



Share this page:
Follow us:
Task Runner