helep mehhhhh | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
22nd Nov 2021, 9:54 PM
Jackson Jameson
Jackson Jameson - avatar
3 Réponses
+ 4
You printing value inside your function, thats why you got None, place return except print inside function. When you dont return anything you get None
22nd Nov 2021, 10:06 PM
PanicS
PanicS - avatar
+ 4
Because there are two print statements. First is inside function and second is outside function. When a function doesn't return anything, it implicitly returns None.,Because of double print function. I suggest you to use return instead of print inside the function definition. def c(n,l): return n+l n = 8 l = 2 print(c(n,l)) https://code.sololearn.com/cYC1W4E28Rbh/?ref=app
22nd Nov 2021, 10:17 PM
MATOVU CALEB
MATOVU CALEB - avatar
0
thx guys
23rd Nov 2021, 5:43 PM
Jackson Jameson
Jackson Jameson - avatar