Re: [Tutor] IF statements-1

2008-10-06 Thread Kent Johnson
On Mon, Oct 6, 2008 at 9:48 PM, WM <[EMAIL PROTECTED]> wrote:
> TO THIS ORIGINAL POST I GOT SIX REPLIES.

> IS THIS THE WAY TO ANSWER?  OR SHOULD I DO INDIVIDUAL REPLIES?

Either way is OK. It helps to quote a bit of the post to which you are
replying, for context. And please don't use all caps, it is
interpreted as shouting. And you seem to be a bit off in your
attributions...

> JOHNSON 1
> The copy above is exactly from the book, via COPY & PASTE, from IDLE26 thru
> More.
> I keyed in the 12 to generate the error message.

You can't just paste the examples verbatim from the tutorial. The
examples are showing you both the text that you type and the output of
the interpreter. In particular the >>> and ... are output and should
not be typed or pasted in.


> JOHNSON 3
> I did not understand Nair's reply, so I didn't follow thru there.
> What is "the entire digest" and how do I not include it?

That was a note to Rajeev, who included a lot of extraneous text in his reply.

Did you start at the beginning of the tutorial or are you starting
with section 4?

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] IF statements-1

2008-10-06 Thread WM

TO THIS ORIGINAL POST I GOT SIX REPLIES.

WM wrote:
> > I used to do Basic and enjoyed it.  Someone said Python was a vastly
> > better language than Visual Basic, which I considered playing with.  So
> > I sought to give it a go but struck a sticking point very early.
> > I am now going through the Python tutorial.  All went well until I came
> > to IF.  The code below was not written by me.  It is a copy/paste job
> > from the tutor.  I do not have any idea what is going wrong.
> >
> > IDLE 2.6 >>>
 
  x = int(raw_input("Please enter an integer: "))
> > Please enter an integer: 42
  if x < 0:
> > ...  x = 0
> > ...  print 'Negative changed to zero'
> > ... elif x == 0:
> > ...  print 'Zero'
> > ... elif x == 1:
> > ...  print 'Single'
> > ... else:
> > ...  print 'More'
> > ...
> > More
> > 12
> > SyntaxError: invalid syntax
 

IS THIS THE WAY TO ANSWER?  OR SHOULD I DO INDIVIDUAL REPLIES?

JOHNSON 1
The copy above is exactly from the book, via COPY & PASTE, from IDLE26 
thru More.

I keyed in the 12 to generate the error message.

JOHNSON 2
All that was running was IDLE from the desktop and the tutor from the 
Python.Org site.
I will not do the down-load right now as I want the tutor to work with 
the program with no tinkering.


JOHNSON 3
I did not understand Nair's reply, so I didn't follow thru there.
What is "the entire digest" and how do I not include it?

LANE
I keyed in "12" & "Enter".  The rest is copy/paste.
I will key the text into Notepad then run it, as you suggest.

GAULD
Not so.  You can check on the tutor, the code stops at 'More'.
It's funny about the dots, they were in the tutor but not in IDLE, 
although the indents were the same.  Then, in the e-mil, there they 
were.  IDLE hides dots?  What do I know?


NAIR
Your post to me starts, "also I believe..."  It looks like the front end 
got truncated.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor