0

Need some help

there is a "return" in my code but it doesn't output anything https://code.sololearn.com/cIJVGnv6Fm7h/?ref=app

14th Nov 2017, 10:25 PM
Hamza Boudouche
5 Answers
+ 2
hmm maybe that's because return isn't supposed to output a value but give the function a value back when it's called!Try reading the Python sololearn course.
14th Nov 2017, 10:30 PM
᠌᠌Code X
᠌᠌Code X - avatar
+ 1
Because you aren't using any print. print(GCD(int(A),int(B)))
14th Nov 2017, 10:42 PM
Ferhat Sevim
Ferhat Sevim - avatar
+ 1
example: def add(x,y): a=x+y return a add(4,5) - This would return 9 and do nothing with it. num=add(4,5) - This would set the variable "num" to a value of 9 as 9 is returned from the function print(add(4,5)) - This would print whatever is returned from the function Return is simply what information you get back from the function. What you so with that is up to you. Return = The info sent back from the function Print = output to the screen
15th Nov 2017, 12:43 AM
LordHill
LordHill - avatar
0
well I did. what should I change to make it work?
14th Nov 2017, 10:33 PM
Hamza Boudouche
0
👍 thanks. in fact the problem is that i dont undestand wats the difference between return and print
14th Nov 2017, 10:48 PM
Hamza Boudouche