Michael George wrote:
Yes you are. "if i == range(1,9)" compares i against the iterator returned by the range function. Assuming i is a number, it will never be equal (since a number is not an iterator). Your function would print "It worked!" if you called print_i(range(1,9)).Actually to correct myself range returns a list, xrange returns an iterator.