[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Quick question from newbie




Yes and also remember that when doing the range remember that having sequential numbers or letters they do not always follow logic such as different character code lists do not. So when using range use the in to look at the list and not a sequence of numbers. Unless you want a sequence to look at. The best example is the EBCDIC code list. There a, b, c does not mean 1, 2, 3...in terms being in a direct sequence

        Bruce

----- Original Message ----- 
From: "Michael George" <mdgeorge@xxxxxxxxxxxxxx>
To: <pygame-users@xxxxxxxx>
Sent: Wednesday, October 31, 2007 9:20 PM
Subject: Re: [pygame] Quick question from newbie


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.