Ah, memory lane time again :-)
>A good natured word of explanation for Chris and others:
> 10 FORN=1TO10:?N:NEXTN: REM It is bad form not to name N after NEXT to
> label which FOR NEXT loop is being incremented.
Oh, you had advanced BASIC - it allowed nested for loops! :-)
My first BASIC only al
Title: Message
Hi
Terry,
Python
is great, very much so if the last you used was Basic.
I
highly recommend Alan Gauld's tutorial, but I look forward to your queries here.
:-)
Liam
Clarke-Hutchinson
-Original Message-From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
> compared Python to old style BASIC. You might find it helpful if you
> were weaned on BASIC. You can still find the old site here:
>
> http://www.freenetpages.co.uk/hp/alan.gauld/oldtutor/
>
> Check out the Loops topic for the GOTO discussion.
Oops, so long since I looked at that version...
> In Basic, I would have said:
>
> 10 x = x + 1 : print x : goto 10
Tsk, tsk, even in BASIC that's considered bad form :-)
10 FOR X =1 to 10
20 PRINT X
30 NEXT
Would be the better BASIC form.
And as you've seen Python provides a close analog to
that in its for loop.
for X in [1,2,3,4,
On Thu, 10 Nov 2005, Terry Kemmerer wrote:
> I'm working on Ch. 5, "Fruitful Functions", or "How To Think Like A
> Computer Scientist" and I still can't count.
> (Don't laugh! I can't play the violin either...)
>
> In Basic, I would have said:
>
> 10 x = x + 1 : print x : goto 10
Good heave
Terry Kemmerer wrote:
> I'm working on Ch. 5, "Fruitful Functions", or "How To Think Like A
> Computer Scientist" and I still can't count.
> (Don't laugh! I can't play the violin either...)
>
> In Basic, I would have said:
>
> 10 x = x + 1 : print x : goto 10
>
> run
> 1
> 2
> 3
> etc
>
>
Terry Kemmerer wrote:
> In Basic, I would have said:
>
> 10 x = x + 1 : print x : goto 10
>
> run
> 1
> 2
> 3
> etc
>
> How is this done in Python? (So I can stop holding my breath as I study
> this great languageand relax.)
In Python there is no goto, as you have discovered. Loops
On 11/11/05, Terry Kemmerer <[EMAIL PROTECTED]> wrote:
> I'm working on Ch. 5, "Fruitful Functions", or "How To Think Like A
> Computer Scientist" and I still can't count.
> (Don't laugh! I can't play the violin either...)
>
> In Basic, I would have said:
>
> 10 x = x + 1 : print x : goto 10