GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Python/Article/PythonBasis/python2/Grammar.md at master · zhanghuaAndroid/Python

Expand file tree

/

Grammar.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
16 lines (8 loc) · 951 Bytes
/

Grammar.md

Copy path

File metadata and controls

16 lines (8 loc) · 951 Bytes
Raw
Copy raw file
Download raw file
Edit and raw actions

一、Python 语法的简要说明

每种语言都有自己的语法,不管是自然语言(英语,中文)还是计算机编程语言。

Python 也不例外,它也有自己的语法规则,然后编辑器或者解析器根据符合语法的程序代码转换成 CPU 能够执行的机器码,然后执行。

Python 的语法比较简单,采用缩进方式。

Python语法.png

如上面的代码截图,以 # 开头的语句是注释,其他每一行都是一个语句,当语句以冒号 : 结尾时,缩进的语句视为代码块。

要注意的是 Python 程序是大小写敏感的,如果写错了大小写,程序会报错。

更多的说明可以看看之前的文章:Python代码规范中的简明概述

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.