Why "none" is print while calling the function?and what is the need of none? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Why "none" is print while calling the function?and what is the need of none?

29th Jan 2017, 6:33 AM
mohamed ibramsha
mohamed ibramsha - avatar
5 Answers
+ 7
In python, if function has no return, it will return None
29th Jan 2017, 7:02 AM
Leshark
Leshark - avatar
+ 4
none is like nil(Lua) like NULL(C++), its basically a no value.
29th Jan 2017, 6:38 AM
Dawzy
Dawzy - avatar
+ 4
All functions "pop something from the call stack" on return, whether you use that value or not. Since the activity of "a value MUST be returned" is deeply implemented in computer science, a generic value MUST act as placeholder when you don't provide one.
3rd Mar 2017, 3:04 AM
Kirk Schafer
Kirk Schafer - avatar
+ 2
None needed to express the abstain of something e.g. if var = None: statement
12th Feb 2017, 1:25 PM
Aries Aprilian
Aries Aprilian - avatar
+ 1
Because "some_func()" has no value ...
7th Feb 2017, 4:31 PM
Hugo Filipe da Cruz Candeias
Hugo Filipe da Cruz Candeias - avatar