Posts

Showing posts with the label variable

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...

Pointers in PYTHON?

 Memory programming is used in programming. A memory area is defined by: - associated variable name, - length as number of bytes, - address of the first byte, - content as a string of bits with contextual interpretation. The contents of the pointer variable are the address of a memory area. A variable is referred to when its address is loaded into a pointer variable. A pointer variable is redirected using its contents to reach the contents of the variable whose address it contains. The reference operator initializes the pointer variable. The pointer referral operator provides the contents of the memory area whose address it contains. And the PYTHON language natural works with pointer variables. PYTHON works differently and spectacular with pointers. (March 31, 2022)

PYTHON Language Programming

PYTHON language programming is: - flexible, - portable, - easy, - free, - accessible,  - intuitive, - versatile, - universal,  - convenient, - ordinary,  - common. PYTHON programming language has taken over the best of all the programming languages before it. It is simple, efficient, dense and attractive. The input() statement is used to enter the data. The print() instruction is used to present the results. Variable names are constructed the same as all other programming languages: - the first character is required a letter, - the other characters are letters, numbers or underscores, - uppercase letters differ from lowercase letters, - any words other than the reserved words of the PYTHON language. - the length of the name does not exceed 31 characters. The string is preceded and followed by quotation marks. The string is preceded and followed by an apostrophe. Correct variable names: a i j temp Triangle surface_cercle  volume_cube Name_P...