Re: [Tutor] Problem with python

2010-10-24 Thread python
> I just wanted to note that Steven is a great teacher! +1 Malcolm ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Problem with python

2010-10-24 Thread Richard D. Moores
On Wed, Oct 20, 2010 at 03:13, Steven D'Aprano wrote: > Let's start with an easy example: factorial(0). When Python sees > factorial(0), it does this: > > Call factorial with argument 0: > * if n == 0 <-- this is true, so execute the "if" block: >    return 1 > > so the function factorial(0) retu

Re: [Tutor] Problem with python

2010-10-20 Thread Dave Kuhlman
On Wed, Oct 20, 2010 at 03:02:43AM +0600, Matthew Nunes wrote: > >To whom it may concern, > > Hi, I've just started learning how >to program in python using Allan B. Downy's book "How to think like a >computer scientist" and it explained something

Re: [Tutor] Problem with python

2010-10-20 Thread Steven D'Aprano
On Wed, 20 Oct 2010 08:02:43 am Matthew Nunes wrote: > I cannot understand the how it claimed the code executed, and > logically it makes no sense to me. Please explain it to me, as I > have spent hours trying to get my head around it, as the book(in my > opinion) did not explain it well. Here it

Re: [Tutor] Problem with python

2010-10-19 Thread Wayne Werner
On Tue, Oct 19, 2010 at 4:02 PM, Matthew Nunes wrote: > To whom it may concern, > >Hi, I've just started learning how to > program in python using Allan B. Downy's book "How to think like a computer > scientist" and it explained something in the recursion chapt

Re: [Tutor] Problem with python

2010-10-19 Thread Emmanuel Ruellan
On Tue, Oct 19, 2010 at 11:02 PM, Matthew Nunes wrote: > > It wrote a piece of code for the factorial function in math for example 3! > is 3 * 2 * 1. I cannot understand the how it claimed the code executed, and > logically it makes no sense to me. > > I suggest you follow the algorithm yourself,

Re: [Tutor] Problem with python

2010-10-19 Thread Alan Gauld
"Matthew Nunes" wrote... ...something in the recursion chapter which have still been unable to understand. It wrote a piece of code for the factorial function Please explain it to me, as I have spent hours trying to get my head around it, Recursion is one of the more baffling topics whe

[Tutor] Problem with python

2010-10-19 Thread Matthew Nunes
To whom it may concern, Hi, I've just started learning how to program in python using Allan B. Downy's book "How to think like a computer scientist" and it explained something in the recursion chapter which have still been

Re: [Tutor] problem with Python Tutorial

2005-08-08 Thread Danny Yoo
On Mon, 8 Aug 2005, Dick Moores wrote: > Danny Yoo wrote at 16:57 8/8/2005: > > > Traceback (most recent call last): > > >File "", line 1, in -toplevel- > > > sys.ps2 > > > AttributeError: 'module' object has no attribute 'ps2' > > > > > > What's wrong? > > > > > >IDLE doesn't use sys.p

Re: [Tutor] problem with Python Tutorial

2005-08-08 Thread Dick Moores
Danny Yoo wrote at 16:57 8/8/2005: > > Traceback (most recent call last): > >File "", line 1, in -toplevel- > > sys.ps2 > > AttributeError: 'module' object has no attribute 'ps2' > > > > What's wrong? > > >IDLE doesn't use sys.ps2. See the thread starting at: > > http://mail.python.or

Re: [Tutor] problem with Python Tutorial

2005-08-08 Thread Danny Yoo
> Traceback (most recent call last): >File "", line 1, in -toplevel- > sys.ps2 > AttributeError: 'module' object has no attribute 'ps2' > > What's wrong? IDLE doesn't use sys.ps2. See the thread starting at: http://mail.python.org/pipermail/idle-dev/2002-February/000862.html _

[Tutor] problem with Python Tutorial

2005-08-08 Thread Dick Moores
Quoting from "6.2 Standard Modules", of the Python Tutorial (): == One particular module deserves some attention: sys, which is built into every Python interpreter. The variables sys.ps1 an