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

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.

主站蜘蛛池模板: 无棣县| 邹城市| 印江| 丰城市| 方城县| 长寿区| 句容市| 永胜县| 新密市| 榆树市| 遂平县| 富蕴县| 阿拉善盟| 临邑县| 深州市| 彩票| 汝阳县| 合肥市| 云阳县| 荔浦县| 米易县| 鄯善县| 红原县| 陈巴尔虎旗| 谢通门县| 南漳县| 磴口县| 五原县| 台北市| 淮北市| 惠水县| 鹤岗市| 武威市| 额尔古纳市| 射洪县| 普洱| 蛟河市| 磐安县| 六枝特区| 陇西县| 鄂托克旗|