[Tutor] Please Help me with this.
Doug Stanfield
DOUGS@oceanic.com
Wed, 20 Oct 1999 09:22:57 -1000
For this type of thing you need to think like the computer.
This example initializes some variables and then loops using the 'while'
construct. Start going through the statements in order, writing down the
value of each of the variables at each step. That should help your
understanding of the output.
If there are specific statements here that you don't understand or can't
figure out what they do, first check the tutorial and the library reference,
then ask more specific questions on the list.
By the way, this is a troubleshooting technique that you will use in
virtually every program you write so its a good discipline to train yourself
in. Definately this will be time well spent.
-Doug-
> -----Original Message-----
> From: Jakomo Mariachi [mailto:jgg813@bse.bg]
> Sent: Wednesday, October 20, 1999 5:41 AM
> To: tutor@python.org
> Subject: [Tutor] Please Help me with this.
>
>
>
> Hello !
>
> I have just eagerly subscribed to this mailing list.
> I have not a big programming experience with Python, but really wanna
> learn it.
>
> When I read this : ( in the manual )
>
> a, b = 0, 1
> while b < 10:
> print b
> a, b = b, a+b
>
> and the outcome 1 1 2 3 5 8 13 21 . . . . . - I can't
> understand how it work.
>
>
> When I try this:
> a = 0
> b = 0
> while b < 10:
> print b
> a = b
> b = a + b
> the outcome is one, but :
> a = 0
> b = 1
> while b < 10:
> print b
> b = a + b
> a = b
> the outcome is different.
>
> So , please help me !
> Thank you in advance !
>
> --- Jako ---
>
>
>
> _______________________________________________
> Tutor maillist - Tutor@python.org
> http://www.python.org/mailman/listinfo/tutor
>