Created
January 6, 2026 12:55
-
-
Save pythonhacker/90cd86704df149f0493fd71462cb2b79 to your computer and use it in GitHub Desktop.
An IQ function written from first principles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def IQ(score): | |
| """ IQ score -> rating """ | |
| if score < 70: | |
| return "intellectually disabled" | |
| elif score in range(70, 85): | |
| return "below average" | |
| elif score in range(85, 115): | |
| return "average" | |
| elif score in range(115, 130): | |
| return "bright" | |
| elif score in range(130, 145): | |
| return "gifted" | |
| elif score in range(145, 160): | |
| return "highly gifted" | |
| elif score in range(160, 180): | |
| return "exceptionally gifted" | |
| elif score > 180: | |
| return "profoundly gifted/genius" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment