A 2300yo algorithm in Python: Euclid's algorithm for the greatest common divisor of two numbers

Опубликовано: 17 Январь 2025
на канале: PatchyPython
27
1

An implementation of Euclid's algorithm for the GCD of two numbers as a function with two arguments. Note that parameters are passed by value - i.e., a copy is created upon calling the function, and the original arguments are unaffected by any changes made within the function.
Check out the notebooks linked below for more information on functions in Python.

Embedded video, part of the following course:
Computer Programming at Queen Mary, University of London
Jupyter notebook: https://tinyurl.com/42ttakps

Notebooks will open on Google Colab - no installation required