Python Automation Development-[first day]-basic data types and encodings

Source: Internet
Author: User

1. Python vs. Other languages

-C-Language interpretation code--machine-to-computer

-high-level languages such as python,java,php code---bytecode---machine----computer

2. Coding

-ASCII

1.ASCII only supports English 256, Chinese is not supported

-Unicode (Universal code)

1.unicode at least 16 people, Chinese and English at least 16 people

-Utf-8

1.utf-8 Chinese 3 bytes, 24 bits, English 1 bytes, 8 bits

-gbk/gbk2312

1.GBK is Chinese 2 bytes

Notice:python interpreter encoding, python3.* default encoding is Utf-8

3. Variables

A. Variables generally consist of letters, numbers, and underscores

B. Cannot start with a number

C. You cannot use some built-in commands as variables

D. Declaring variables using _ (underline) to differentiate words, or use hump

4. Comments

A. Single-line comment #

#!/usr/bin/python#print (' Hello Dragon ')

B. Multi-line comment "" "" ""

#!/usr/bin/python#! -*-coding:utf-8-*-"" "Print (' Hello Dragon ') print (' Hello Dragon ') print (' Hello Dragon ')" ""

6. List

Python automation Development-[first day]-basic data type and encoding

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.