Skip to content

Commit 54c1888

Browse files
committed
Update 1.md
1 parent 9a33e6e commit 54c1888

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

1.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ You can also type mathematical statements. Python will compute the result and ec
8787
>>>
8888
```
8989

90-
Also note that the spaces between numbers and operators are not important. They just make the code easier to read when they are used correctly.
90+
Also note that the spaces between numbers and operators don't affect the evaluation order. They just make the code easier to read when they are used correctly.
9191

9292
```py
9393
>>> 14 + 2 + 1
@@ -97,7 +97,7 @@ Also note that the spaces between numbers and operators are not important. They
9797
>>>
9898
```
9999

100-
Calculations are done in the same order as in math. The parenthesis `(` and `)` also work the same way.
100+
The evaluation order is similar to math. The parenthesis `(` and `)` also work the same way.
101101

102102
```py
103103
>>> 1 + 2 * 3 # 2 * 3 is calculated first
@@ -106,7 +106,7 @@ Calculations are done in the same order as in math. The parenthesis `(` and `)`
106106
9
107107
>>>
108108
```
109-
Square brackets `[]` and curly brackets `{}` cannot be used instead of parenthesis. Square brackets are for making lists and curly brackets for making sets and dictionaries. Again, all that will be covered later.
109+
Square brackets `[]` and curly brackets `{}` cannot be used to change the evaluation order. Square brackets are for making lists and curly brackets for making sets and dictionaries. Again, all that will be covered later.
110110

111111
```py
112112
>>> [1 + 2] * 3
@@ -118,7 +118,7 @@ TypeError: unsupported operand type(s) for *: 'set' and 'int'
118118
>>>
119119
```
120120

121-
When you get an error message like this one, don't get scared. Read it instead. It tells you what's wrong and where. In this case it says that we are using `*` with a set and an integer, not two integers. We'll learn more about sets later in this tutorial.
121+
When you get an error message like this one, don't get scared. Read it instead. It tells you what's wrong and where. In this case it says that we are using `*` with a set and an integer, not two integers.
122122

123123
### More advanced math
124124

@@ -163,16 +163,16 @@ This is also useful for converting time from minutes to seconds. 500 seconds is
163163
`**` can be used to raise to a power, so 3² in math is `3**2` in Python. Powers are calculated before `*` and `/`, but after `()`.
164164

165165
```py
166-
>>> 3 ** 2
167-
9
168-
>>> 2 * 3 ** 4 # 3 ** 4 is calculated first
169-
162
170-
>>> (2 * 3) ** 4 # 2 * 3 is calculated first
171-
1296
166+
>>> 2 ** 3
167+
8
168+
>>> 2 * 3 ** 2 # 3 ** 2 is calculated first
169+
18
170+
>>> (2 * 3) ** 2 # 2 * 3 is calculated first
171+
36
172172
>>>
173173
```
174174

175-
The `math` module contains more useful things.
175+
The [math module](https://docs.python.org/3/library/math.html) contains more useful things.
176176

177177
```py
178178
>>> from math import pi, sqrt
@@ -192,12 +192,10 @@ Python uses radians instead of degrees, so degrees need to be converted to radia
192192
>>>
193193
```
194194

195-
See the [official documentation of the math module](https://docs.python.org/3/library/math.html) for more info about it.
196-
197195
### Exercises
198196

199197
1. A company needs to buy new computers and monitors. With taxes, a new monitor costs 49,95 € and a new computer costs 200 €. How much would 100 computers cost without taxes, when the taxes are 24 % of the price?
200-
2. Taken from [here](http://www.greenteapress.com/thinkpython/html/thinkpython003.html):
198+
2. Taken from [this book](http://www.greenteapress.com/thinkpython/html/thinkpython003.html):
201199

202200
> The volume of a sphere with radius r is 4/3 π r³. What is the volume of a sphere with radius 5?
203201

0 commit comments

Comments
 (0)