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
Watch video A 2300yo algorithm in Python: Euclid's algorithm for the greatest common divisor of two numbers online without registration, duration hours minute second in high quality. This video was added by user PatchyPython 07 October 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 27 once and liked it 1 people.