Python Basics "day03": Getting Started knowledge supplements

Source: Internet
Author: User

First, Scope

For the scope of the variable, execute the declaration and exist in memory, the variable can be used in the following code.

123 if1==1:    name = ‘wupeiqi‘printname

The following conclusions, right?

outer variables, which can be used by inner variables, cannot be used by outer variables
two or three-dollar operation
1 result =1 if 条件 else2

If the condition is true: result = value 1
If the condition is false: result = value 2

Third, the binary
    • Binary, 01
    • Octal, 01234567
    • Decimal, 0123456789
    • Hex, 0123456789ABCDEF
Python Basics

For Python, everything is an object, objects are created based on the class

Therefore, the following values are objects: "Wupeiqi", 38, [' Beijing ', ' Shanghai ', ' Shenzhen '), and are objects generated from different classes.

Python Basics "day03": Getting Started knowledge supplements

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.