3 ms·
> "if variable is None" Is missing : We all know we should do the following, it's much clearer. # Example of a dictionary to check None > # Assign None to a
by throwaway154 3y ago
> "if variable is None"
Is missing :
We all know we should do the following, it's much clearer.
# Example of a dictionary to check None
> # Assign None to a variable
> myvar = None
> # Declare dictionary to check None
> mydictionary = {None: 'None is stored in this variable'}
> print(mydictionary[myvar])
If I expected something, I would try it.