PYTHON and variables?
PYTON does not work with variables. PYTON works with: - name, - objects, - types, - values, - reference number. If we write: a = 7 then: - a is the name - a PYTHON object corresponding to the name a is created - 7 is value - the type is whole - the reference count is 0. if we write below a = 100 then: - remain the same name, - a new object associated with the name a is created, - the type is integer, - the reference count is 1 This explains the different addresses id (a) from the first assignment and from the second assignment. Programe is: a = 7 print(id(a)) a = 100 print(id(a)) Results are: ============== RESTART: /Users/ionivan/Documents/pointerspython.py ============= 4408295856 4408298832 If the sequence is considered: a = 25 b = a the names a and b correspond to the same object, so they will have the same address. Programul este: a = 25 b = a print("Adress a name is",id(a)) print("Adress b name is",id(b)) Rezultatele sunt: ============== RESTART: /Users/ioniv...