Let's say we have a collection as { 16, 17, 4, 3, 5, 2,10 }. Given a range 2,10 we need to find out the numbers between the range. The range values are inclusive. The below program will do so
from System import *
from System.Collections.Generic import *
from System.Linq import *
class Program(object):
def Main(args):
intList = List[int](16, 17, 4, 3, 5, 2, 10)
lowerRange = 2
upperRange = 10
intList.Where().OrderBy().ToList().ForEach()
Console.ReadKey()
Main = staticmethod(Main)
Result
------- 2
3
4
5
10