[Tutor] Python 3 - bugs or installation problem

Dave Angel davea at davea.name
Thu Mar 5 03:18:11 CET 2015


On 03/04/2015 09:11 PM, boB Stepp wrote:
> On Wed, Mar 4, 2015 at 7:53 PM, Phil <phil_lor at bigpond.com> wrote:
>> I hope this is not another embarrassingly obvious answer to a simple
>> question.
>>
>> Python 3, under Kubuntu.
>>
>> xrange() fails whereas range() is accepted. Could this be an installation
>> problem?
>> etc
>
> This may fall into the obvious answer. ~(:>))
>
> My Python reference says that the xrange function was discontinued in
> Python 3, which you are using.
>
> "In Python 3.x, the original range() function is changed to return an
> iterable instead of producing a result in memory, and thus subsumes
> and [sic?] Python 2.x's xrange(), which is removed." -- Python Pocket
> Reference, 5th ed., by Mark Lutz.
>

And the other half of the answer is that your IDLE is apparently using 
the Python 2 interpreter, in which print is defined differently.


-- 
DaveA


More information about the Tutor mailing list