Python Math – Floor Division

In Python, there is a built in operator for floor-division.

As a reminder, floor-division is when you want to do division and get rid of the decimal point so that you get an integer result.

For example

#Normal division.
4/3
1.33333333333

#Floor division.
4//3
1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s