0

does the return statement dépends on thé argument given to thé function? because this function prints none because there was no argument given to it.

30th Jul 2016, 5:32 PM
Alain Eros Prestige Musoni
Alain Eros Prestige Musoni - avatar
2 Respostas
+ 1
Not directly. 'return' will actually return whatever you pass to it. ex: def func(x): return x**2 print(func(6)) in example above the function gets x and after processing the input returns it. But if you just use return with no value, it will return none. The return statement without value is used for exiting the function early under special conditions.
30th Jul 2016, 5:42 PM
Alireza M
Alireza M - avatar
0
ofcorse thar will return 36
30th Jul 2016, 5:45 PM
Alain Eros Prestige Musoni
Alain Eros Prestige Musoni - avatar