1
- [ Contents] ( ../Contents ) \| [ Previous (1.1 Python)] ( 01_Python ) \| [ Next (1.3 Numbers)] ( 03_Numbers )
1
+ [ Contents] ( ../Contents.md ) \| [ Previous (1.1 Python)] ( 01_Python.md ) \| [ Next (1.3 Numbers)] ( 03_Numbers.md )
2
2
3
3
# 1.2 A First Program
4
4
@@ -51,7 +51,7 @@ hello world
51
51
This so-called * read-eval-print-loop* (or REPL) is very useful for debugging and exploration.
52
52
53
53
** STOP** : If you can't figure out how to interact with Python, stop what you're doing
54
- and figure out how to do it. If you're using an IDE, it might be hidden behind a
54
+ and figure out how to do it. If you're using an IDE, it might be hidden behind a
55
55
menu option or other window. Many parts of this course assume that you can
56
56
interact with the interpreter.
57
57
@@ -63,7 +63,7 @@ Let's take a closer look at the elements of the REPL:
63
63
The ` ... ` prompt may or may not be shown depending on your environment. For this course,
64
64
it is shown as blanks to make it easier to cut/paste code samples.
65
65
66
- The underscore ` _ ` holds the last result.
66
+ The underscore ` _ ` holds the last result.
67
67
68
68
``` python
69
69
>> > 37 * 42
@@ -109,7 +109,7 @@ C:\SomeFolder>c:\python36\python hello.py
109
109
hello world
110
110
```
111
111
112
- Note: On Windows, you may need to specify a full path to the Python interpreter such as ` c:\python36\python ` .
112
+ Note: On Windows, you may need to specify a full path to the Python interpreter such as ` c:\python36\python ` .
113
113
However, if Python is installed in its usual way, you might be able to just type the name of the program
114
114
such as ` hello.py ` .
115
115
@@ -265,7 +265,7 @@ Indentation groups the following statements together as the operations that repe
265
265
num_bills = num_bills * 2
266
266
```
267
267
268
- Because the ` print() ` statement at the end is not indented, it
268
+ Because the ` print() ` statement at the end is not indented, it
269
269
does not belong to the loop. The empty line is just for
270
270
readability. It does not affect the execution.
271
271
@@ -275,7 +275,7 @@ readability. It does not affect the execution.
275
275
* Use 4 spaces per level.
276
276
* Use a Python-aware editor.
277
277
278
- Python's only requirement is that indentation within the same block
278
+ Python's only requirement is that indentation within the same block
279
279
be consistent. For example, this is an error:
280
280
281
281
``` python
@@ -464,12 +464,12 @@ NameError: name 'days' is not defined
464
464
Reading error messages is an important part of Python code. If your program
465
465
crashes, the very last line of the traceback message is the actual reason why the
466
466
the program crashed. Above that, you should see a fragment of source code and then
467
- an identifying filename and line number.
467
+ an identifying filename and line number.
468
468
469
469
* Which line is the error?
470
470
* What is the error?
471
471
* Fix the error
472
472
* Run the program successfully
473
473
474
474
475
- [ Contents] ( ../Contents ) \| [ Previous (1.1 Python)] ( 01_Python ) \| [ Next (1.3 Numbers)] ( 03_Numbers )
475
+ [ Contents] ( ../Contents.md ) \| [ Previous (1.1 Python)] ( 01_Python.md ) \| [ Next (1.3 Numbers)] ( 03_Numbers.md )
0 commit comments