Q:

Python program to find greatest integer using floor() method

belongs to collection: Python basic programs

0

The greatest integer function is a function (real numbers function) to itself that is defined as follows: it sends any real number to the largest integer that is less than or equal to it.

The greatest integer function of floor method example 0 is denoted by floor method example 1.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Python code to find greatest integer (Use of floor() method)

# Python code to find greatest integer 
# (Use of floor() method)

import math #importing class

num = float(input("Enter any float number: "))
print("math.floor(num): ", math.floor(num))

num = float(input("Enter another float number: "))
print("math.floor(num): ", math.floor(num))

Output

Enter any float number: 56.892
math.floor(num):  56
Enter another float number: -34.567
math.floor(num):  -35

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Python basic programs

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Python program to find the maximum EVEN number... >>
<< Python program to design a biased coin flip functi...