Ah, memory lane time again :-)
Oh, you had advanced BASIC - it allowed nested for loops! :-)
My first BASIC only allowed for loops that could be written in a single
line...Anything more complex you had to call a subroutine with GOSUB.
Ha! Yes! As Monte Python would say, "Well..It got
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
A good natured word of explanation for Chris and others:
Rest assured I am not criticizing the FORM and USE of white space that Python so eloquently uses,
and subsequently makes it so beautiful and easy to read to the eye, by my example
of a single line of BASIC. Actually, back in the day, I
lf Of
Terry KemmererSent: Friday, 11 November 2005 12:25
p.m.To: Python_TUTORSubject: [Tutor] Newbie
Anxiety
(I accidentally sent this to the
originator. Sorry.)Sweet! Almost everything is sooo
familiar, yet, merged in many interesting ways. I never had a DO WHILE
statement, but in many
I want to thank everyone for their responses. This has help tremendously to ease my mind. Thanks!
Branching in the program, is actually my real anxiety, as I have been feeling the void, (maybe
that should be WITHDRAWALS!) as I am working my way through How To Think Like a Computer
Scientist
(I accidentally sent this to the originator. Sorry.)
Sweet!
Almost everything is sooo familiar, yet, merged in many interesting ways. I never had a DO WHILE statement, but
in many ways, your further examples are like a combination of my old FOR NEXT loop and IF logical evaluation statement
> 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
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
I don't know why, but this great UNKNOWN bother
13 matches
Mail list logo