+ 1

Can anyone help me code to find the GCD between 2 lists in Python? Big thanks! :)

For example, Input: A=[2,12,24] B=[4,6,15] Output: [2,6,3] def gcd(A,B):

26th Mar 2018, 7:25 AM
Vicky Kuo
Vicky Kuo - avatar
3 Antworten
+ 2
I have a code that works with gcd, but different. Maybe it helps: https://code.sololearn.com/cyKGTg8rMzae/?ref=app
26th Mar 2018, 7:46 AM
Paul
Paul - avatar
+ 2
I gave it a try. The output is what you want but my function gcd takes two numbers as input. But not two lists. But the result is the same, https://code.sololearn.com/clKouDm46NbB/?ref=app
26th Mar 2018, 9:19 AM
Paul
Paul - avatar
+ 1
Big thanks!! :)))) have a good day!
26th Mar 2018, 10:23 AM
Vicky Kuo
Vicky Kuo - avatar