Repository navigation
Expand file tree
/
Copy path3-python-syntax.html
More file actions
754 lines (428 loc) · 34.6 KB
/
Copy path3-python-syntax.html
File metadata and controls
754 lines (428 loc) · 34.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>2.3 Python 语法 · GitBook</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.3">
<link rel="stylesheet" href="../gitbook/style.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="4-python-request.html" />
<link rel="prev" href="2-python.html" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="1.1" data-path="../">
<a href="../">
介绍
</a>
</li>
<li class="chapter " data-level="1.2" data-path="../1.Kickoff/">
<a href="../1.Kickoff/">
KickOff Party
</a>
<ul class="articles">
<li class="chapter " data-level="1.2.1" data-path="../1.Kickoff/1-teaching-goals.html">
<a href="../1.Kickoff/1-teaching-goals.html">
1.1 教学目的
</a>
</li>
<li class="chapter " data-level="1.2.2" data-path="../1.Kickoff/2-software-tool.html">
<a href="../1.Kickoff/2-software-tool.html">
1.2 软件和工具
</a>
</li>
<li class="chapter " data-level="1.2.3" data-path="../1.Kickoff/3-pre-homework.html">
<a href="../1.Kickoff/3-pre-homework.html">
1.3 课前自学
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" data-path="./">
<a href="./">
Python 简介
</a>
<ul class="articles">
<li class="chapter " data-level="1.3.1" data-path="1-data-engineering-intro.html">
<a href="1-data-engineering-intro.html">
2.1 数据工程介绍
</a>
</li>
<li class="chapter " data-level="1.3.2" data-path="2-python.html">
<a href="2-python.html">
2.2 Python 介绍
</a>
</li>
<li class="chapter active" data-level="1.3.3" data-path="3-python-syntax.html">
<a href="3-python-syntax.html">
2.3 Python 语法
</a>
</li>
<li class="chapter " data-level="1.3.4" data-path="4-python-request.html">
<a href="4-python-request.html">
2.4 Python 请求
</a>
</li>
<li class="chapter " data-level="1.3.5" data-path="5-python-syntax-advanced.html">
<a href="5-python-syntax-advanced.html">
2.5 Python 语法进阶
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" data-path="../3.Crawler/">
<a href="../3.Crawler/">
爬虫
</a>
<ul class="articles">
<li class="chapter " data-level="1.4.1" data-path="../3.Crawler/1-python-html.html">
<a href="../3.Crawler/1-python-html.html">
3.1 HTML
</a>
</li>
<li class="chapter " data-level="1.4.2" data-path="../3.Crawler/2-full-site-crawler.html">
<a href="../3.Crawler/2-full-site-crawler.html">
3.2 爬虫实战
</a>
</li>
<li class="chapter " data-level="1.4.3" data-path="../3.Crawler/3-python-json.html">
<a href="../3.Crawler/3-python-json.html">
3.3 选学:JSON 简介
</a>
</li>
<li class="chapter " data-level="1.4.4" data-path="../3.Crawler/4-login-and-js-render.html">
<a href="../3.Crawler/4-login-and-js-render.html">
3.4 选学:爬虫的难点
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" data-path="../4.Processing/">
<a href="../4.Processing/">
数据处理
</a>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="../4.Processing/1-data-processing.html">
<a href="../4.Processing/1-data-processing.html">
4.1 初见数据处理
</a>
</li>
<li class="chapter " data-level="1.5.2" data-path="../4.Processing/2-data-practice.html">
<a href="../4.Processing/2-data-practice.html">
4.2 数据处理应用实例
</a>
</li>
<li class="chapter " data-level="1.5.3" data-path="../4.Processing/3-pandas.html">
<a href="../4.Processing/3-pandas.html">
4.3 选学:Pandas
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" data-path="../demo.html">
<a href="../demo.html">
Demo练习
</a>
</li>
<li class="chapter " data-level="1.7" data-path="../project.html">
<a href="../project.html">
大作业
</a>
</li>
<li class="chapter " data-level="1.8" data-path="../sharing-and-learning-suggestions.html">
<a href="../sharing-and-learning-suggestions.html">
分享与后续学习建议
</a>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href=".." >2.3 Python 语法</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<h1 id="python-语法">Python 语法</h1>
<blockquote>
<p>Cooking time: 30 mins active / 45 mins passive</p>
<p><strong>Learning by Doing</strong>:</p>
<ul>
<li>提示:切换到英文输入法编程可以避免一些用错符号的错误。</li>
<li><strong>Tasks for Learners</strong>: 请学员创建第二个Python文件 <code>python_syntax_practice.py</code>, 对下列Python语法进行练习。</li>
<li><strong>Tasks for Coaches</strong>: 请教练对学员的练习提供一定的辅助,请控制好时间。</li>
</ul>
</blockquote>
<h2 id="魔法注释">魔法注释</h2>
<p>惯例:把这一行写在 Python 文件的头一行,表达这个文件的非 ASCII 字符的编码为 UTF-8,不然遇到中文会出现编码错误。</p>
<pre><code class="lang-python"><span class="hljs-comment"># encoding: utf-8</span>
</code></pre>
<h2 id="注释">注释</h2>
<p>注释是写给阅读代码的人看的,计算机会忽略注释。一行中以 <code>#</code> 开始直到行末的部分都属于注释。</p>
<pre><code class="lang-python"><span class="hljs-comment"># 可以在代码中穿插写一些笔记,不影响程序的执行。</span>
</code></pre>
<h2 id="基本数据类型">基本数据类型</h2>
<p>整数,类型为 <code>int</code></p>
<pre><code class="lang-python"><span class="hljs-number">1234</span>
<span class="hljs-number">-1234</span>
</code></pre>
<p>小数(浮点数),类型为 <code>float</code></p>
<pre><code class="lang-python"><span class="hljs-number">3.1415926</span>
</code></pre>
<p>字符串,类型为 <code>str</code></p>
<pre><code class="lang-python"><span class="hljs-string">"双引号字符串"</span> <span class="hljs-comment"># 注意要用半角英文引号包起来</span>
<span class="hljs-string">'单引号字符串'</span>
</code></pre>
<p>字符串中,空格也是字符:</p>
<pre><code class="lang-python"><span class="hljs-string">" "</span> <span class="hljs-comment"># 这也是一个字符串</span>
</code></pre>
<p>有一些字符也是没有对应的字形(Glyph),但是可以用 <strong>转义字符</strong> 表达:</p>
<pre><code class="lang-python"><span class="hljs-string">"\n"</span> <span class="hljs-comment"># 换行</span>
<span class="hljs-string">"\r"</span> <span class="hljs-comment"># 回车</span>
<span class="hljs-string">"\t"</span> <span class="hljs-comment"># tab</span>
</code></pre>
<p>以上的字符串写法有个限制:只能写在一行内。Python 支持三个引号的多行字符串语法,方便书写多行的内容:</p>
<pre><code class="lang-python"><span class="hljs-string">"""
床前明月光
疑是地上霜
举头望明月
低头思故乡
"""</span>
</code></pre>
<p>特殊量 -- 代表什么都没有</p>
<pre><code class="lang-python"><span class="hljs-keyword">None</span>
</code></pre>
<p>查看数据的类型</p>
<pre><code class="lang-python">type(<span class="hljs-number">3</span>) <span class="hljs-comment"># int</span>
</code></pre>
<h2 id="运算">运算</h2>
<p>在 Jupyter 中输入下面的表达式试试:</p>
<pre><code class="lang-python"><span class="hljs-number">1</span> + <span class="hljs-number">1</span>
<span class="hljs-number">2.5</span> * <span class="hljs-number">3</span>
<span class="hljs-number">4</span> / <span class="hljs-number">2</span>
</code></pre>
<p>除以 0 会得到 NaN(Not a Number)</p>
<pre><code class="lang-python"><span class="hljs-number">1</span> / <span class="hljs-number">0</span> <span class="hljs-comment"># NaN</span>
</code></pre>
<p>字符串也可以进行连接运算(使用 <code>+</code> 运算符)</p>
<pre><code class="lang-python"><span class="hljs-string">"hello"</span> + <span class="hljs-string">" world"</span>
</code></pre>
<p>注意:全角符号和半角符号的区别。</p>
<h2 id="变量">变量</h2>
<p>用一个名称代表一个值(<code>=</code> 叫做赋值运算符)</p>
<pre><code class="lang-python">a = <span class="hljs-number">3</span>
some_variable_1 = <span class="hljs-string">"一个值"</span> <span class="hljs-comment"># 变量名可以包含字母、数字和下划线,但不能以数字打头</span>
</code></pre>
<p>这个符号代表的值可以重新赋值,所以这个量称为变量 -- variable。</p>
<p>运算的结果可以赋予变量,变量也可以参加运算,例如下面计算平均值的代码:</p>
<pre><code class="lang-python">sum = <span class="hljs-number">1</span> + <span class="hljs-number">2</span> + <span class="hljs-number">3</span> + <span class="hljs-number">4</span> + <span class="hljs-number">5</span>
average = sum / <span class="hljs-number">5.0</span>
print(average)
</code></pre>
<h2 id="条件">条件</h2>
<p>在 Python 中表达逻辑:“如果” 满足某种条件 “那么” 你就给我做这件事情。</p>
<p>布尔类型(注意大小写)</p>
<pre><code class="lang-python"><span class="hljs-keyword">True</span>
<span class="hljs-keyword">False</span>
</code></pre>
<p>条件语法</p>
<pre><code class="lang-python"><span class="hljs-keyword">if</span> <span class="hljs-keyword">True</span>:
print(<span class="hljs-string">"真"</span>)
<span class="hljs-keyword">if</span> <span class="hljs-keyword">False</span>:
print(<span class="hljs-string">"假"</span>)
</code></pre>
<p>注意:</p>
<ul>
<li>「如果」部分以关键字 <code>if</code> 开始,接着是条件表达式,后面必须再加上冒号 <code>:</code></li>
<li>「那么」部分的缩进要比 <code>if</code> 行深,推荐用 4 个空格缩进(参考 <a href="https://www.python.org/dev/peps/pep-0008/#indentation" target="_blank">PEP8</a>)</li>
</ul>
<p>上面两个条件内容互斥,我们可以用双路条件 <code>if</code>……<code>else</code>:</p>
<pre><code class="lang-python">t = <span class="hljs-keyword">True</span>
<span class="hljs-keyword">if</span> t:
print(“真”)
<span class="hljs-keyword">else</span>:
print(<span class="hljs-string">"假"</span>)
</code></pre>
<p>布尔类型上可以用布尔运算:</p>
<ul>
<li>而且 <code>and</code></li>
<li>或者 <code>or</code></li>
<li>否定 <code>not</code></li>
</ul>
<p>练习:思考下面几个表达式的值并在 IPython 验证:</p>
<pre><code class="lang-python"><span class="hljs-keyword">True</span> <span class="hljs-keyword">and</span> <span class="hljs-keyword">True</span>
<span class="hljs-keyword">not</span> <span class="hljs-keyword">False</span>
<span class="hljs-keyword">False</span> <span class="hljs-keyword">or</span> <span class="hljs-keyword">True</span>
</code></pre>
<p>比较运算符可以判断两个值是否相等或者孰大孰小:</p>
<ul>
<li><code>==</code> 等于(两个等号,注意和赋值运算的不同)</li>
<li><code>></code> 大于</li>
<li><code><</code> 小于</li>
<li><code>!=</code> 不等于</li>
<li><code>>=</code> 大于或者等于</li>
<li><code><=</code> 小于或者等于</li>
</ul>
<p>练习:思考下面几个表达式的值并在 IPython 验证:</p>
<pre><code class="lang-python"><span class="hljs-number">1</span> <= <span class="hljs-number">3</span>
<span class="hljs-number">5</span> > <span class="hljs-number">4</span> <span class="hljs-keyword">and</span> <span class="hljs-number">4</span> > <span class="hljs-number">3</span>
</code></pre>
<p>综合运用条件语句和比较运算符:「如果天气晴朗并且低于 30 度就出去玩」</p>
<pre><code class="lang-python">weather = <span class="hljs-string">"rainy"</span>
temperature = <span class="hljs-number">20</span>
<span class="hljs-keyword">if</span> weather == <span class="hljs-string">"sunny"</span> <span class="hljs-keyword">and</span> temperature < <span class="hljs-number">30</span>:
print(<span class="hljs-string">"lets go out!"</span>)
</code></pre>
<h2 id="循环">循环</h2>
<p>计算机是处理数据的机器。循环(迴圈)告诉机器重复做相同的工作。</p>
<p><code>while</code> 循环打印 0 到 100</p>
<pre><code class="lang-python">a = <span class="hljs-number">0</span>
<span class="hljs-keyword">while</span> a <= <span class="hljs-number">100</span>:
print(a)
a = a + <span class="hljs-number">1</span>
</code></pre>
<p>同样注意别忘了 <code>:</code> 和缩进</p>
<p>循环一般由循环条件和循环体组成。</p>
<p>练习:使用 Spyder 观察程序的执行:</p>
<ol>
<li>在 temp.py 中输入代码<br><img src="input_code.png" alt=""></li>
<li>点击 Debug file 工具<br><img src="debug_tools.png" alt=""></li>
<li>多次点击 Run current line 工具,观察 Variable explorer 的变化<br><img src="variable_explorer.png" alt=""></li>
<li>最后点击 Stop debugging 结束 debug</li>
</ol>
<p><strong>死循环</strong> 的意思是:不会结束的循环。</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> time
<span class="hljs-keyword">while</span> <span class="hljs-keyword">True</span>:
print(<span class="hljs-string">"I am stuck"</span>)
time.sleep(<span class="hljs-number">1</span>)
</code></pre>
<p>要结束程序,可以按 Ctrl + C 退出。(一个手指按住 Ctrl 键,然后另一个手指按 C 键,退出时解释器会报告一段错误,意思是收到了中断信号)。</p>
<p>循环控制:</p>
<ul>
<li><code>continue</code> 进入下一个轮回</li>
<li><code>break</code> 结束循环</li>
</ul>
<p>(todo 循环控制例子)</p>
<h2 id="函数">函数</h2>
<p>我们学习了用一个词代表值(变量),在 Python 中我们也能用一个词代表一段代码。</p>
<p>定义函数用 <code>def</code> 关键字,接上函数名称,参数列表和冒号。试理解下面的代码:</p>
<pre><code class="lang-python"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">double</span><span class="hljs-params">(x)</span>:</span>
<span class="hljs-keyword">return</span> x * <span class="hljs-number">2</span>
</code></pre>
<p>在缩进的代码块中编写函数体,使用 <code>return</code> 返回需要的内容。</p>
<p>之前我们学习的 <code>print</code>, <code>len</code> 都是函数,而且是是 Python 自带的函数 (built-in functions)。</p>
<p>调用函数:</p>
<pre><code class="lang-python">double(<span class="hljs-number">4</span>)
</code></pre>
<p>由于函数返回的是一个值,这个值也可以赋予给变量:</p>
<pre><code class="lang-python">twice = double(<span class="hljs-number">4</span>)
four_times = double(twice)
</code></pre>
<p>函数返回的值也可以传递给下一个函数:</p>
<pre><code class="lang-python">print(double(<span class="hljs-number">4</span>))
</code></pre>
<p>小提示:Python 的运算符 <code>+</code>,<code>-</code>,<code>*</code>,<code>/</code> 等等其实都是函数。</p>
<p>(todo 小问题和练习)</p>
<h2 id="输入和输出简介">输入和输出简介</h2>
<p>IO 是输入/输出(input / output)的缩写。</p>
<p>IO 是程序能从真实世界获取信息 (输入),对真实世界产生影响(输出)的基础。</p>
<p>典型的输入包括:用户键盘输入,鼠标点击,读取文件,读取网络数据,获取传感器的读数,……</p>
<p>典型的输出包括:在屏幕显示文字,在屏幕绘制图像,输出到打印机,发出声音,发送数据到网络端口,……</p>
<h2 id="读写文件">读写文件</h2>
<p>读写文件是 Python 里最基本的 IO 操作之一。</p>
<p><code>open</code> 函数打开一个文件,<code>"r"</code> 模式是读取,<code>"w"</code> 模式是写入。</p>
<p>以读取模式打开一个文件 "foo.csv",并返回对应的文件对象:</p>
<pre><code class="lang-python">f = open(<span class="hljs-string">"foo.csv"</span>, <span class="hljs-string">"r"</span>)
</code></pre>
<p>关闭一个文件对象:</p>
<pre><code class="lang-python">f.close()
</code></pre>
<p>下面的代码打开文件,读取文件的内容,然后关闭文件。</p>
<pre><code class="lang-python">f = open(<span class="hljs-string">"foo.csv"</span>, <span class="hljs-string">"r"</span>)
data = f.read()
f.close()
print(data)
</code></pre>
<p>但是,在对文件操作的时候有可能发生异常!例如文件编码不正确,或者出现了没考虑到的某种状况,就会出错。</p>
<blockquote>
<p>没处理各种异常情况的一段程序,不能成为一个产品</p>
</blockquote>
<p>Python 提供了 <code>with .. as</code> 语法, 不用处理异常和写 <code>close</code>,就能保证处理文件后能自动关闭它。</p>
<p>读取一个文件</p>
<pre><code class="lang-python"><span class="hljs-keyword">with</span> open(<span class="hljs-string">"foo.csv"</span>, <span class="hljs-string">"r"</span>) <span class="hljs-keyword">as</span> f:
data = f.read()
</code></pre>
<p>写入一个文件</p>
<pre><code class="lang-python"><span class="hljs-keyword">with</span> open(<span class="hljs-string">"foo.csv"</span>, <span class="hljs-string">"w"</span>) <span class="hljs-keyword">as</span> f:
f.write(data)
</code></pre>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="2-python.html" class="navigation navigation-prev " aria-label="Previous page: 2.2 Python 介绍">
<i class="fa fa-angle-left"></i>
</a>
<a href="4-python-request.html" class="navigation navigation-next " aria-label="Next page: 2.4 Python 请求">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"2.3 Python 语法","level":"1.3.3","depth":2,"next":{"title":"2.4 Python 请求","level":"1.3.4","depth":2,"path":"2.Python/4-python-request.md","ref":"2.Python/4-python-request.md","articles":[]},"previous":{"title":"2.2 Python 介绍","level":"1.3.2","depth":2,"path":"2.Python/2-python.md","ref":"2.Python/2-python.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"2.Python/3-python-syntax.md","mtime":"2018-10-30T03:08:38.630Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-30T04:36:00.086Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>
<script src="../gitbook/gitbook.js"></script>
<script src="../gitbook/theme.js"></script>
<script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="../gitbook/gitbook-plugin-search/search.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>