Its data doesn't
represent any reasonable value - actually, it's not a value at all; hence,
it mustn't take part in any expressions.
“None” is a keyword.
This cause a runtime error, described by the above message.
There are only two
kinds of circumstances when “None” can be safely used:
- when you assign it to a variable (or
return it as a function's result)
- when you compare it with a variable to
diagnose its internal state.
If a function doesn't return a
certain value using a return expression clause, it is assumed that it implicitly
returns “None”.
Sometimes it may be the symptom of a subtle mistake inside the function.
Sometimes it may be the symptom of a subtle mistake inside the function.
Output is