Created
January 6, 2026 13:25
-
-
Save pythonhacker/5ed0492377734b202ab5807608d08087 to your computer and use it in GitHub Desktop.
IQ function rewritten using the custom range dictionary
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 function using range dictionary """ | |
| scores_class_dict={0: 'intellectually disabled', | |
| 70: 'below average', | |
| 85: 'average', | |
| 115: 'bright', | |
| 130: 'gifted', | |
| 145: 'highly gifted', | |
| 160: 'exceptionally gifted', | |
| 180: 'profoundly gifted/genius' | |
| } | |
| d = RangeDict(scores_class_dict) | |
| return d[score] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment