+ 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
6 odpowiedzi
+ 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
+ 3
tnx...
+ 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
+ 1
thanks
0
Can some one do gcd of n numbers in python without list for m plz.
0
Can some one do it in python whitn more than two numbers for n numers