Skip to content

Glossary: Data Structures and Algorithms

Floor division (//) and modulo (%)

Also written: //, %, floor division

`//` divides and drops the remainder (`7 // 2` is 3), while `%` gives the remainder (`7 % 2` is 1). Together they let you find a middle index in a list or turn 570 minutes into 9 hours and 30 minutes.

Where the book teaches it

Related terms

Binary searchf-string format codes (:02d, :<, :>)