Python basic built-in data type

Source: Internet
Author: User

Python's basic built-in data types are:

Basic data types, such as Integer (number), string, tuple, list, dictionary, and Boolean types.

1) integral type--int--digit
Python has 5 types of numbers, the most common being the integral type Int,int Python method is very useful. Example: 1234,-1234


2) Boolean--bool--notation = =
Boolean is a special type of Python number, it is only true and false two kinds of values, it is mainly used to compare and judge, the result is called a Boolean value. For example: 3==3 gives true,3==5 gives false


3) string--str--with "' or" "
For example: ' Python ' or ' hello '


4) List--list--with [] notation
Example: [1,2,3,4]


5) tuple--tuple--with () notation
For example: (' d ', 300)


6) Dictionary--dict--in {} notation
For example: {' name ': ' Cco ', ' paw ': ' Iion '}


What is mutable in the Python base data type and which is immutable

Python variable data type: List list[], dictionary dict{}
Python immutable data type: int, string str ', tuple tuple ()

Python basic built-in data type

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.