all numbers from to that are multiples of or sum for in xrange( )is the modulo operator if = or = sum + in python range always returns an iteratorand thus it is not necessary to use the xrange function ternary expressions ternary expression in python allows you combine an if-else block which produces value into single line or expression the syntax for this in python is value true-expr if condition else false-expr heretrue-expr and false-expr can be any python expressions it has the identical effect as the more verbose if conditionvalue true-expr elsevalue false-expr this is more concrete examplein [ ] in [ ]'non-negativeif > else 'negativeout[ ]'non-negativeas with if-else blocksonly one of the expressions will be evaluated while it may be tempting to always use ternary expressions to condense your coderealize that you may sacrifice readability if the condition as well and the true and false expressions are very complex data structures and sequences python' data structures are simplebut powerful mastering their use is critical part of becoming proficient python programmer data structures and sequences www it-ebooks info