how to get the ordinal number in list
Marko Rauhamaa
marko at pacujo.net
Mon Aug 11 08:41:00 EDT 2014
alister <alister.nospam.ware at ntlworld.com>:
> It already is a different operator from equality which is ==
>
> perhaps it would have been better if the behaviour of these two
> operators were reversed (= for equality & == for assignment) but i
> suspect that Idea if even considered was quickly discarded as it would
> cause major confusion to programmers who work with multiple languages
Blame it on FORTRAN:
X = X + 1
IF (X .EQ. 100) GOTO 999
BASIC took a no-nonsense approach:
5 LET S = 0
10 MAT INPUT V
20 LET N = NUM
30 IF N = 0 THEN 99
40 FOR I = 1 TO N
45 LET S = S + V(I)
50 NEXT I
60 PRINT S/N
70 GO TO 5
99 END
(<URL: http://en.wikipedia.org/wiki/BASIC#Examples>)
Marko
More information about the Python-list
mailing list