官术网_书友最值得收藏!

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code, variables, function names, URLs, or other keywords are written in a specific font, for example. Variables are lower case with underscores separating words. Functions or class names are follow the CamelCase convention (for example, processData) where the first word is lowercase and any following word is capitalized. Function, method, or class names will also by followed by a pair of parenthesis to logically separate them from variables. We will display all code meant for the Python interactive prompt or in a file.

A block code written in the interactive prompt is preceded by three ">" or "." symbols emulating what a user would see when typing the data into the interactive prompt.

Python Interactive Prompt Code
>>> a = 5
>>> b = 7
>>> print a + b
13

A block of code written in a file will contain a line number on the left side of the file followed by the code on that line. Indentation is important in Python and all indents should be at increments of 4 spaces. Lines may wrap due to margin lengths. Please refer to the provided code for clarification on indentations and layout.

Python Script
001 def main():
002     a = 5
003     b = 7
004     print a + b

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

主站蜘蛛池模板: 莱阳市| 龙泉市| 京山县| 乌拉特后旗| 五大连池市| 万州区| 怀安县| 沂源县| 兴安县| 达日县| 昌图县| 沛县| 县级市| 马山县| 金沙县| 寿阳县| 五家渠市| 闻喜县| 班玛县| 盐亭县| 千阳县| 遂宁市| 商河县| 镇宁| 隆昌县| 正阳县| 偏关县| 太保市| 年辖:市辖区| 克山县| 新宾| 九江县| 文山县| 桦川县| 湖南省| 西乌珠穆沁旗| 富宁县| 青浦区| 通江县| 九龙城区| 遂宁市|