Python3 Data types

Source: Internet
Author: User
Tags set set

First, Python can customize the data type, the default data types are:

1, int integer

2, float floating point number

3, complex plural

4, BOOL Boolean value

5. STR string

6, List

7. Tuple tuples

8. Set Set

9. Dict Dictionary

#type: Built-in function to view the data type of the variable#int integervar = 1Print(Var, type (var))#float floating point numbervar = 1.0Print(Var, type (var))#complex pluralvar = 1 + 1jPrint(Var, type (var))#BOOL Boolean value only two values, True and Falsevar =TruePrint(Var, type (var))#the STR string is a string, whether it contains a few charactersvar ="This is a test1"Print(Var, type (var))#List Listsvar = [1, 2, 3]Print(Var, type (var))#Tuple tuplesvar = (1, 2, 3)Print(Var, type (var))#Set Setvar = {1, 2, 3}Print(Var, type (var))#Dict Dictionaryvar = {"a": 1,"b": 2,"C": 3}Print(Var, type (VAR))

Python3 Data types

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.