To those who will continue saynig (0..20).contains(index) is better than 0..20 ~= index which I fond to use I will point Why operators are useful essay of Guido van Rossum.