I have a problem in a python programe "gcd of two number without loop" please help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I have a problem in a python programe "gcd of two number without loop" please help

i write a programe of gcd of two number without loop in python but there is error my programe is alright but why is this error.. plz solve this.. https://code.sololearn.com/c4Fe4i447JwP/?ref=app https://code.sololearn.com/c4Fe4i447JwP/?ref=app

3rd Sep 2017, 9:40 AM
Mool Singh
Mool Singh - avatar
6 Answers
+ 3
There's nothing wrong with your code, you might just be entering the numbers incorrectly. Try separating your inputs with a new line. Example (Python): 10 5
3rd Sep 2017, 9:50 AM
Ghauth Christians
Ghauth Christians - avatar
+ 3
tnx...
3rd Sep 2017, 9:53 AM
Mool Singh
Mool Singh - avatar
+ 1
Also, sorry, but you need a loop or use a recursion method to do that algorithm because gcd(12, 2) == 2 and your program answers 10... Do you need to rethink that algorithm
3rd Sep 2017, 12:32 PM
Amaras A
Amaras A - avatar
+ 1
thanks
13th Oct 2017, 12:06 PM
Mool Singh
Mool Singh - avatar
0
Can some one do gcd of n numbers in python without list for m plz.
24th Jan 2019, 5:39 AM
youssef al haouil
youssef al haouil - avatar
0
Can some one do it in python whitn more than two numbers for n numers
24th Jan 2019, 8:56 PM
youssef al haouil
youssef al haouil - avatar