if number is 1-2, 4 or 6-8 or 12-28, 30, 32...

Gustaf Liljegren gustafl at algonet.se
Mon Jun 10 23:25:06 CEST 2002


I'm making a function that takes one integer and returns a boolean that 
says if the integer matches a number in a certain group of numbers. This 
group consists of single numbers aswell as ranges spanning thousands of 
numbers. I'm looking for an elegant way to write this function.

Thanks in advance!

Gustaf



More information about the Python-list mailing list