We need to take care here, `!=` and `is not` are different operators. The first is to compare the value and the last is to compare the same instance (same memory address).

I have done a post about it http://elyezer.com/diferenca-entre-e-is-no-python/ (in Portuguese). I'll comment the examples:

```python
>>> n = 5
>>> n == 5
True
>>> n is 5
True
>>> l = [1]
>>> l == [1]
True
>>> l is [1]
False
```

When using an integer they appear the same because Python have some caching when dealing with some range of integers and some strings. The cache does not happen for floats and mutable objects for example.

```python
>>> n = 1000
>>> n == 1000
True
>>> n is 1000
False
>>> f = 1.0
>>> f == 1.0
True
>>> f is 1.0
False
```

In the other examples given on the post is presented the cache range and some other operations. If something is not clear I can try to explain better.