Python core programming-python objects
1. What is a python object?
In python, any type of value constructed is an object. For example, a value of the integer type, a string, and a list can all be seen as objects.
All objects are divided into three parts:
(1) identity. Each object has its own id. View with built-in function id ()
(2) type. View available type ()
(3) value. Objects are used to store data. Of course, the most important data is its value.
Ii. Standard Type
Number, integer, Boolean, long integer, floating point, plural, String, list, tuples, Dictionary, module, Class
Iii. Slice object
Step slice, multi-dimensional slice
(1) Stepping slice sequence [Starting index: Ending index: Stepping value]
>>> List1 = [,] >>> list1 [] [1, 3, 5, 7]
(2) multi-dimensional slice sequence [star1: end1, start2: end2]
Iv. Standard built-in functions
(1) type () return type
(2) cmp (a, B) if a> B, a positive integer is returned. If
(3) str () to character type
V. Type Factory
Int (), long, float ()....