Python Lesson – 5.1 None

Python Lessons - 5.1 None

None

The None object is used when the absence of a value is to be represented. It has very similar functions to null in other programming languages.

This object is returned whenever a function returns no value.

def foo():
    print("OK!")
    
var = foo()
print(var) 

If you run it, you get:

>>>
OK!
None

⇐ Go to Python Lesson 4.9 – Handling files

Go to Python Lesson 5.2 Dictionaries ⇒

Leave a Reply