There's no 'pointers' in Python, like there are in C++ (or similar languages). The only distinction in Python is mutable vs. immutable. But all variables are just references to objects.
Variables with immutable types refer to values that you cannot modify, only replace. int is an example of an immutable type.
When you run your code, you assign 5 to i, then you assign the value of i to j, so that j now also has the value 5, but since these are immutable values, you can only change the entire value of either variable, which won't affect the value of the other.
Variables with mutable types have values that you can modify. list is an example of a mutable type.
When you run this:
xs = [1, 2, 3]
ys = xs
xs[0] = 999
The last statement modifies the value of both variables, as the list that was the value of xs is the same list that was assigned to ys and the final instruction modifies that value.
Immutable types including numbers, strings and tuples as well as a few other simple types. Mutable types include lists, dictionaries, and most other more complex classes.
Also, for example have a look at this:
a = 1
b = 1
c = b + 1
d = 2
print(id(a), id(b), id(c), id(d))
This will print four numbers, but note how the first two numbers will be the same (as they both refer to 1) and the second two are the same as well (as they both refer to 2).
Having said all that, if you want to test if something is mutable, there's no easy way to do that - but a common reason to want to do so is because you want to test if something is hashable, which you could test:
s = 'test'
print(s.__hash__ is None) # False
xs = [1, 2, 3]
print(xs.__hash__ is None) # True
is_pointer = lambda variable: Falsei.__hash__ is Nonevsj.__hash__ is None, since immutable types are typically hashable, and mutable types typically are not (although there's no real guarantee - you can make either statement false if you really want to, but for practical cases this works)j = i, python fully resolvedito an anonymous object and then assigned that object toj.jhas no idea that the object happened to come fromi.