Python core programming-python objects

Source: Internet
Author: User

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

 

 

 

 

 


 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.