Python variable type code example

Source: Internet
Author: User

Python variables are commonly used in computer languages. You may have some knowledge about them, but do you know about several types of Python variable types? If you have a better understanding of Python variable types, you can browse our article.

Python has a variable type, and it will forcibly check the variable type.

The built-in variable types are as follows:

Integer

 
  1. Integer_number = 90

Floating Point

 
  1. Float_number = 90.4

Plural

 
  1. Complex_number = 10 + 10j

List Sequence

 
  1. Sample_list = [1, 2, 3, 'abc']

Dictionary

 
  1. Sample_dic = {"key": value, 2: 3}

Tuple read-only sequence

 
  1. Sample_tuple = (1, 3, "AB ")

The above is a detailed explanation of the Python variable type code.

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.