Question 1:
None is an object. It is of type "NoneType".
This can be seen by doing something like this in the terminal:
>>> type(None)
<type 'NoneType'>
So, when you put this object in a list, the list has one element.
Question 2:
The assignment operator in Python, =
, is used to attach a name to an object. In the case of immutable objects, like integers, multiple names can be attached to the same object. That is what you are doing with a
and b
. So, when you test their identity, using the is
operator, you see that the two names point to the identical object.
Alternatively, when you attach a name to a newly created list (which you created with the []
operator) it is a different list each time.