I have used the get_or_create function on my models in Django. This function returns two values. One is the object itself and the other a boolean flag that indicates whether an existing object was retrieved or a new one created.
Normally, a function can return a single value or a collection of values like a tuple, list or a dictionary.
How does a function like get_or_create return two values?
get_or_create()simply returns a tuple of the two values. You can then use sequence unpacking to bind the two tuple entries to two names, like in the documentation example: