Scientific Computing and Algorithms @ SISSA 2021

Exam solutions by Kosio Karchev


General note

Motivated by the fact that this library is a one-off effort intended as a demonstration of coding and algorithmic thinking abilities, and that it contains exclusively atomic implementations of well-defined (finalised) algorithms, the style of the code it contains is guided less by the usual factors—readability, maintainability, and others defined in the Zen of Python—and much more by the intent of “having fun with coding” and (ab)using the “cool features” of the language, as subjectively determined by the author, resulting in numerous superfluous iterator comprehensions, variable definitions therein1, and various other one-liner “hacks”.

1

Note that as of Python 3.9 (bpo-32856) definitions like (... for name in [value]) are accelerated internally and equivalent in performance to usual name binding like name = value.