How do i get all integers between two values in python?

Intern Kiet :

i want to get all the integers which are between two values. Example: i have an interval (2.4 , 5.6). As an output then i want to have (3,4,5).

Is there any function that does this?

Greetings

miszcz2137 :

Try this:

import math
list(range(math.ceil(num1), math.floor(num2) + 1))

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=19432&siteId=1