@@ -60,6 +60,31 @@ We didn't get an error... but `(3, 14)` is not at all what we expected!
60
60
So from now on, let's use a dot with decimal numbers, because ` 3.14 `
61
61
worked just fine. Later we'll learn what ` (3, 14) ` is.
62
62
63
+ ## Comments
64
+
65
+ We can also type a ` # ` and then whatever we want after that. These bits
66
+ of text are known as ** comments** , and we'll find uses for them later.
67
+
68
+ ``` python
69
+ >> > 1 + 2 # can you guess what the result is?
70
+ 3
71
+ >> >
72
+ ```
73
+
74
+ Again, I put a space after the ` # ` and multiple spaces before it just to
75
+ make things easier to read.
76
+
77
+ If we write comment on a line with no code on it, the prompt changes
78
+ from ` >>> ` to ` ... ` . To be honest, I have no idea why it does that and I
79
+ think it would be better if it would just stay as ` >>> ` . The prompt goes
80
+ back to ` >>> ` when we press Enter again.
81
+
82
+ ``` python
83
+ >> > # hello there
84
+ ...
85
+ >> >
86
+ ```
87
+
63
88
## Using Python as a calculator
64
89
65
90
``` diff
@@ -112,31 +137,6 @@ time you don't need them. Actually you don't need even these
112
137
calculations most of the time, but these calculations are probably
113
138
enough when you need to calculate something.
114
139
115
- ## Comments
116
-
117
- We can also type a ` # ` and then whatever we want after that. These bits
118
- of text are known as ** comments** , and we'll find uses for them later.
119
-
120
- ``` python
121
- >> > 1 + 2 # can you guess what the result is?
122
- 3
123
- >> >
124
- ```
125
-
126
- Again, I put a space after the ` # ` and multiple spaces before it just to
127
- make things easier to read.
128
-
129
- If we write comment on a line with no code on it, the prompt changes
130
- from ` >>> ` to ` ... ` . To be honest, I have no idea why it does that and I
131
- think it would be better if it would just stay as ` >>> ` . The prompt goes
132
- back to ` >>> ` when we press Enter again.
133
-
134
- ``` python
135
- >> > # hello there
136
- ...
137
- >> >
138
- ```
139
-
140
140
## Summary
141
141
142
142
[ comment ] : # ( the first line in this summary is exactly same as in )
0 commit comments