Let
We will try to find an
The complete algorithm is illustrated in the following diagram in which we start by taking a random number
As we can see, there are three questions to be answered in the algorithm. Let's code up some functions that answer them in this first exercise:
is_coprime
: receives two integers and returns True
if they are coprime or False
otherwise.is_odd
: given an integer returns True
if it is odd and False
otherwise.is_not_one
: given False
if they are equal.The value of
To interact with codercises, please switch to a larger screen size.
Learning Objectives: