Reputation: 71
I want to get all the integers which are between two float values.
Example:
I have an interval (2.4 , 5.6)
. As an output I want to have (3, 4, 5)
.
Is there any function that does this?
Upvotes: 5
Views: 3009
Reputation: 914
Try this:
import math
list(range(math.ceil(num1), math.floor(num2) + 1))
Upvotes: 8