[Tutor] Truckers Log....Me Again

Erik Price erikprice@mac.com
Mon, 21 Jan 2002 00:23:15 -0500


Hello everyone,

This is my first post to the list.  I've spent the past couple of months 
learning PHP as my first programming language (except the obligatory 
BASIC from years ago, and a smattering of bash/AppleScript -ing) and 
thought to extend my skillset.  It seems that everyone is recommending 
Python for aspiring self-taught programmers.  I have a few questions, 
and the first of them stems from this example:

On Sunday, January 20, 2002, at 11:53  PM, Danny Yoo wrote:

> It sounds like you want to do something like the following pseudocode
>
> ##
> while 1:
>     read the input x
>     if x == yes:
>         do this
>     elif x == no:
>         do the other thing
>     else:
>         print some warning
> ###

Admittedly, I am new so I don't know anything.  But it would seem to me 
that this "while" loop would never end, since the condition "1" 
evaluates to "true" infinitely.  I would assume that this is for the 
sake of example, and not to demonstrate an actual program's pseudocode.  
But on this list I have seen more than one example use this convention.  
Is Python different from other languages in this respect?

Another question I have is about objects.  I appreciate the "dumb 
question" thread from earlier this weekend, since I do not completely 
grasp the notion of objects myself.  I have done a brief tutorial in 
PHP's classes from a book, but haven't seen a situation where it would 
be helpful to me so far.  (Though this could easily be due to my 
inexperience in programming.)

One of the reasons Python is recommended so heavily is that it is "true 
object oriented".  And in response to 14-yr old Jimmy's request for 
programming assistance, another python-tutor-lister recommended becoming 
familiar with the use of objects.  Is the use of objects somehow more 
tightly integrated into Python than in other languages such as PHP and 
Perl?  I had assumed that I could learn Python's syntax and hopefully 
get started with some small-scale development as a learning exercise, 
and worry about objects later.  But is it a better idea to try to tackle 
this topic as early on as possible?

Thanks in advance for any answers to these questions.  I look forward to 
learning more.



Erik