Send Close Add comments: (status displays here)
Got it!  This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
Python: Comparison operator chaining


1. Python: Comparison operator chaining
In CS 101, one learns that languages (such as C, Java, etc.) do not accept the following.
if (min1 < i1 <= max1) {    ...    }

Welcome to Python, where the language is adapted to the programmer instead of the programmer to the language. Here is the Python code.

Here is the output of the Python code.


2. End of page

3. Multiple choice questions for this page