Nov-30-2018, 03:08 PM
(Nov-30-2018, 10:11 AM)Gribouillis Wrote: Here is a case where you need something differentwell in that case yes, its required. More often than not though, they are not comparing an empty container, None, or a boolean value.
def explain_python_value(value): if value is False: print('This is the boolean constant meaning "false".') elif value is None: print('The None object is often used to indicate an absence of value.') elif value == []: print("It's the empty list!") else: print('I have not yet been taught what this object is...')
Recommended Tutorials: