You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Chapter1/Chapter1_Introduction.ipynb
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -187,7 +187,7 @@
187
187
"\n",
188
188
"Culture\n",
189
189
"-------\n",
190
-
"The name Python was taken by Guido van Rossum from british TV program *Monty Python Flying Circus*, and there are many references to the show in language documentation. For instance, Python oficial package repository was called Cheese Shop, the name of one of the frames of the programa. Currently, the repository name isAtualmente, o nome do reposit\u00f3rio \u00e9 [Python Package Index](http://pypi.python.org/pypi) (PYPI).\n",
190
+
"The name Python was taken by Guido van Rossum from british TV program *Monty Python Flying Circus*, and there are many references to the show in language documentation. For instance, Python oficial package repository was called Cheese Shop, the name of one of the frames of the programa. Currently, the repository name is [Python Package Index](http://pypi.python.org/pypi) (PYPI).\n",
191
191
"\n",
192
192
"The goals of the project were summarized by Tim Peters in a text called *Zen of Python* , which is available in Python itself using the command:"
"[Python for Developers](http://ricardoduarte.github.io/python-for-developers/#content)\n",
15
+
"=============================\n",
16
+
"First edition\n",
17
+
"-----------------------------------\n",
18
+
"\n",
19
+
"Chapter 2: Syntax\n",
20
+
"===================\n",
21
+
"___________________\n",
22
+
"A program written in Python consists of lines, which may continue in the following lines, by using the backslash character (`\\`) at the end of the line or parentheses, brackets or braces in expressions that use such characters.\n",
23
+
"\n",
24
+
"The character `#` marks the beginning of a comment. Any text after the `#` will be ignored until the end of the line, with the exception of functional comments.\n",
25
+
"\n",
26
+
"Functional comments are used for:\n",
27
+
"\n",
28
+
"+ change the encoding of the source file of the program by adding a comment with the text `# - * - coding: <encoding> - # -` at the beginning of the file, in which `<encoding> ` is the file encoding (usually latin1 or utf-8). Change encoding is required to support characters that are not part of the English language, in the source code of the program.\n",
29
+
"+ define the interpreter that will be used to run the program on UNIX systems, through a comment starting with `#!` at the beginning of the file, which indicates the path to the interpreter (usually the comment line will be something like` #! / usr / bin / env python` ).\n",
30
+
"\n",
31
+
"Example of functional comments:"
32
+
]
33
+
},
34
+
{
35
+
"cell_type": "code",
36
+
"collapsed": false,
37
+
"input": [
38
+
"#!/usr/bin/env python\n",
39
+
"\n",
40
+
"# A code line that shows the result of 7 times 3\n",
"The command `print` inserts spaces between expressions that are received as a parameter, and a newline character at the end, unless he receives a comma at the end of the parameter list.\n",
96
+
"\n",
97
+
"Blocks\n",
98
+
"------\n",
99
+
"In Python, code blocks are defined by the use of indentation, which should be constant in the code block, but it is considered good practice to maintain consistency throughout the project and avoid mixing tabs and <span class = \"note\" title = \"The official recommendation coding style (http://www.python.org/dev/peps/pep-0008/) is to use four spaces for indentation and this convention is widely accepted by developers.\"> spaces </ span >.\n",
100
+
"\n",
101
+
"The line before the block always ends with a colon (:) and is a control structure of the language or a statement of a new structure (a function, for example).\n",
102
+
"\n",
103
+
"\n",
104
+
"\n",
105
+
"Example:"
106
+
]
107
+
},
108
+
{
109
+
"cell_type": "code",
110
+
"collapsed": false,
111
+
"input": [
112
+
"# For i on the list 234, 654, 378, 798:\n",
113
+
"for i in [234, 654, 378, 798]:\n",
114
+
" # If the remainder dividing by 3 is equal to zero:\n",
115
+
" if i % 3 == 0:\n",
116
+
" # Prints...\n",
117
+
" print i, '/ 3 =', i / 3"
118
+
],
119
+
"language": "python",
120
+
"outputs": [
121
+
{
122
+
"output_type": "stream",
123
+
"stream": "stdout",
124
+
"text": [
125
+
"234 / 3 = 78\n",
126
+
"654 / 3 = 218\n",
127
+
"378 / 3 = 126\n",
128
+
"798 / 3 = 266\n"
129
+
]
130
+
}
131
+
],
132
+
"prompt_number": 1
133
+
},
134
+
{
135
+
"cell_type": "markdown",
136
+
"source": [
137
+
"The operator `%` computes the modulus (remainder of division)."
0 commit comments