y
is our way of aligning ourselves to the larger Project Jupyter.a mod b
is zero and you've the greatest common denominator. And it works every time! There's even error handling! Over all that's a pretty versatile function, and a neat little piece of code.def
means, you have no clue what while
does. What is isinstance
? What's a float
? if
? Why is it spaced all funny? A percent sign? Even if this function was heavily commented, it might still be somewhat unapproachable for beginners. How would you go about constructing a simple Python example that would find greatest common divisors?