Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
math.gcd
math.gcd
Return the greatest common divisor of integers a and b.
Python 3.13
math
.
gcd
(
a
,
b
)
a
The first number.
b
The second number.
Examples
Python 3.13
>>
>
import
math
>>
>
math
.
gcd
(
12
,
8
)
4