[Tutor] OT: [was] A question about None

dn PyTutor at DancesWithMice.info
Sun Aug 22 16:56:51 EDT 2021


On 23/08/2021 06.01, Dennis Lee Bieber wrote:
> On Sun, 22 Aug 2021 20:29:02 +1200, dn via Tutor <tutor at python.org>
> declaimed the following:
> 
>> back in the good?bad, old days, wasn't there (a language with) an
>> if-statement that went something like:
>>
>> if expression is positive, or zero, or negative:
>>   goto positive-branch, zero-branch, negative-branch
> 
> 	FORTRAN Arithmetic IF
> 
> (as I recall:
> 
> 	IF (x) 100, 200, 300
> ...
> 
> 100		continue
> C		negative condition logic here
> ...
> 200		continue
> C		zero condition logic here
> ...
> 300		continue
> C		positive condition logic here


You got it!

That's exactly what my fuzzy-mind was trying to recall. Did we call it
an "Arithmetic IF"?

Probably, more-or-less completely displaced when "Logical-IFs" arrived,
eg IF ( A .LT. B ) THEN stmt; in FORTRAN-77.


Relevance to this thread?

The OP offered:

        if distance_sensor.get_distance_cm() > 20:
...
        if distance_sensor.get_distance_cm() < 20:

with the observed omission of the equals-condition.

So, my ancient bones were taking me back to multiple, mutually-exclusive
conditions, but like the Python language without a case/select command:

	IF ( distance - 20 ) THEN 100, 200, 300
-- 
Regards,
=dn


More information about the Tutor mailing list