mirror of
https://github.com/apachecn/ailearning.git
synced 2026-04-24 10:34:08 +08:00
2020-10-19 21:08:55
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
安装好 `Python` 之后,在命令行下输入:
|
||||
|
||||
```
|
||||
```py
|
||||
python
|
||||
```
|
||||
|
||||
@@ -24,12 +24,12 @@ python
|
||||
|
||||
In [1]:
|
||||
|
||||
```
|
||||
```py
|
||||
print "hello world!"
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
```py
|
||||
hello world!
|
||||
|
||||
```
|
||||
@@ -38,7 +38,7 @@ hello world!
|
||||
|
||||
可以将这句话的内容保存到一个文本文件中,并使用后缀名 `.py` 结尾,例如 `hello_world.py`,在命令行下运行这个程序:
|
||||
|
||||
```
|
||||
```py
|
||||
python hello_world.py
|
||||
```
|
||||
|
||||
@@ -54,12 +54,12 @@ python hello_world.py
|
||||
|
||||
In [2]:
|
||||
|
||||
```
|
||||
```py
|
||||
import this
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
```py
|
||||
The Zen of Python, by Tim Peters
|
||||
|
||||
Beautiful is better than ugly.
|
||||
@@ -88,7 +88,7 @@ Namespaces are one honking great idea -- let's do more of those!
|
||||
|
||||
In [3]:
|
||||
|
||||
```
|
||||
```py
|
||||
s = """Gur Mra bs Clguba, ol Gvz Crgref
|
||||
|
||||
Ornhgvshy vf orggre guna htyl.
|
||||
@@ -120,7 +120,7 @@ print "".join([d.get(c, c) for c in s])
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
```py
|
||||
The Zen of Python, by Tim Peters
|
||||
|
||||
Beautiful is better than ugly.
|
||||
|
||||
Reference in New Issue
Block a user