0
What's wrong in this code?, it is returning none when called!
x=48 y=18 def gcd(a,b): quot=a/b if quot>0: rem=a%b if rem>0: e=b%rem quot=quot-1 a=b b=e else: print(rem) else: print(quot) gcd(x,y)
3 Respuestas
+ 3
Both print statements are in the ‘else’ blocks. As it is written, both of your ‘if’ statements will return True, so neither print statements will be executed.
+ 1
Thanks for your answer sir
0
It is not printing anything though i wrote a print statement in function
Return statement is missing intentionally