Why 'none' is considered special in python??? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Why 'none' is considered special in python???

3rd Nov 2018, 1:00 PM
partha
partha - avatar
3 Antworten
+ 3
None is just a value that commonly is used to signify 'empty', or 'no value here'. It is a signal object; it only has meaning because the Python documentation says it has that meaning. There is only one copy of that object in a given Python interpreter session. If you write a function, and that function doesn't use an explicit  return  statement, None is returned instead, for example. That way, programming with functions is much simplified; a function always returns  something, even if it is only that one None object.
3rd Nov 2018, 5:23 PM
Maninder $ingh
Maninder $ingh - avatar
+ 1
It's a placeholder
3rd Nov 2018, 1:43 PM
PureLogicality
PureLogicality - avatar
+ 1
thanks @Maninder Singh and @PureLogicality
4th Nov 2018, 3:52 AM
partha
partha - avatar