Python program to discover floor division

floor division in Python: Here, we will figure out how to discover floor division utilizing floor division (//) administrator in Python?

At the point when we partition a number by another number – division administrator (/) return remainder, it might be a whole number or buoy.

Be that as it may, when we need remainder without drifting number – we can floor division (//) administrator, it returns

the remainder (result) without skimming focuses.

Example:

    Input:
    a = 10
    b = 3

    # finding division
    result1 = a/b;
    print(result1)

    # finding floor division
    result2 = a//b
    print(result2)

    Output:
    3.3333333333333335
    3

Python program to get floor division:

# python program to find floor division

a = 10
b = 3

# finding division
result1 = a/b
print("a/b = ", result1)

# finding floor division
result2 = a//b
print("a/b = ", result2)

Output:

a/b =  3.3333333333333335
a/b =  3

Leave a Comment

error: Alert: Content is protected!!