Python Basics (i)

Source: Internet
Author: User

The concept of Python modules

Every file in Python that ends with a. Py can be used as a module
___

Definition of a variable
    • The variables need not be declared beforehand;
    • The variable does not need to specify a type;
      ***

      Basic data types in Python
    • Digital
    • Integer integer type
    • Boolean Boolean type
    • Long integer length int
    • Floating point real number float type
    • Complex number plural type
    • String strings
    • List lists
    • Tuple tuples
    • Diction dictionary
      ***

in Python # denotes a single-line comment shortcut key ctrl+/
Variable of character type

Print (' variable of character type ')
str1 = ' 1, MJS, one '
Print (STR1)
Print (Type (STR1))
Print (")
***

Variable of digital type

Print (' numeric variable ')
num = 1
Print (num)
Print (type (num))
Print (")
***

Variable of dictionary type

Print (' variable of dictionary type ')
Dict1 = {' name ': ' DLM ', ' Age ': 18}
Print (DICT1)
Print (Type (DICT1))
Print (")
***

Variable of list type

Print (' Variable of list type ')
List1 = [' DLM ', 18]
Print (List1)
Print (Type (LIST1))
Print (")
***

Variables of the tuple type

Print (' variable of tuple type ')
Tup1 = (' DLM ', 18)
Print (TUP1)
Print (Type (TUP1))
Print (")
***

Python Basics (i)

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.