Basic built-in data types for Python basic tutorials

Source: Internet
Author: User
What are the basic built-in data types for Python

Some basic data types, such as Integer (number), string, tuple, list, dictionary, and Boolean types.
As learning progresses, you will also be exposed to more and more interesting data types, as Python beginners get to know these types first.

Basic built-in data type correspondence symbol

1) integral type--int--digit
Python has 5 numeric types, the most common being integer int. 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: ' www.iplaypython.com ' 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 ': ' Coco ', ' country ': ' China '}

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

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