Python basic syntax

Source: Internet
Author: User
Python basic Syntax 1. First Python code
print(‘Hello Word!‘)
2. Notes

1. Definition: annotation is interpreted, mainly used to prompt the relevant code information.

2. Annotation Categories: single-line comments and multiline comments

单行注释:# 注释内容多行注释:‘‘‘ 注释内容 ‘‘‘ 或 """ 注释内容 """
3. Variables

1. Definition: variable is the amount that can be changed

2. Naming rules:

1.汉字变量名能用,不推荐使用2.数字不能开头3.不可以使用特殊字符,除_4.变量区分大小写5.可以使用关键字,但不推荐使用6.常用_和驼峰法,但不推荐两种类型一起使用

3. Format:

变量名 = 值例:gf = ‘grilfriend‘

Note: Multiple variables can be endowed with the same value, and the previous assignment will be washed out when the same variable is assigned again.

4. Indent

The important sign of Python's writing format is indentation, which is indented to 4 spaces, and the same level of content uses the same indentation.

Python basic syntax

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.