Python identify in which interval the numbers are
问题 I would like to run a for loop in Python that checks, given a certain amount of intervals, for each element of the loop, in which interval it is. For instance: interval_1 = [1; 10] interval_2 = [11; 58] I was looking for a more elegant solution than a large if/elif/else condition, for instance my idea was to load an excel worksheet containing n couples of numbers corresponding to the interval extremities, and use a function that finds me for in which interval my number is. Does a similar