Skip to content

Commit a1c1971

Browse files
walterwalter
authored andcommitted
python2/Grammar:截图转 markdown 代码块 + 输出块
1 parent 3f24ccf commit a1c1971

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

Article/PythonBasis/python2/Grammar.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,20 @@ Python 也不例外,它也有自己的语法规则,然后编辑器或者解
66

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

9-
![Python语法.png](http://upload-images.jianshu.io/upload_images/2136918-b9b072c2587cc89e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
9+
```python
10+
# 判断一个数是否是正整数
11+
a = 88
12+
if a >= 0:
13+
print('yes')
14+
else:
15+
print('NO')
16+
```
17+
18+
输出结果:
19+
20+
```
21+
yes
22+
```
1023

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

0 commit comments

Comments
 (0)