Index Ai Academy
Glossary · Phase 0 · Tools

Chained comparison

Also written: chained comparisons

A test with the value in the middle, such as 18 <= age < 25. It means both comparisons must hold.

Try it now

Whenever you write an interval, test both of its edges before you trust it.

Learn it properly

Ranges and edges in code · At least, under and between as symbols; intervals with each end in or out; bands with no gaps. About 32 minutes.

Other terms from the same lesson

  • absolute value: A number with its minus sign dropped: the absolute value of -3 is 3.
  • clamping: Pulling a number back to the nearest edge of a range, as max(0, min(x, 100)) does.
  • half-open interval: A stretch of numbers that includes its start and leaves out its end, such as 18 ≤ age < 25. Half-open bands fit together with no gap and no overlap.
Keep learning

More in plain English.

1286 terms in the glossary, each with the lesson that teaches it.

1286 terms

The glossary

Every word you'll meet in AI and machine learning, explained in everyday language.

Phase 0 · lesson 32 min

Ranges and edges in code

At least, under and between as symbols; intervals with each end in or out; bands with no gaps.

Never trained an AI? Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account. Teach it to write