Skip to content

Commit 9e2e7dd

Browse files
committed
Fixes and updates
1 parent af6bbc7 commit 9e2e7dd

File tree

5 files changed

+56
-51
lines changed

5 files changed

+56
-51
lines changed

02 Constants, Variables and Basic Operations/1 Constants and their types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ More on the use of tuples and how to extract their individual elements will be p
6161

6262
## Operations on values
6363

64-
You can act on the values supported by Python using mathematical operators. The basic operators are `+`, `-`, `*` (multiplication), `/` (division), `**` (power), `//` (integer division), `%` (division remainder). Python can perform operations according to the applicable mathematical rules (the use of parentheses is allowed). To read them, start the Spyder program and enter the following expressions in the interactive console (it is not necessary to use the `print` function - the interactive shell will automatically print the result of the calculated expression):
64+
You can act on the values supported by Python using mathematical operators. The basic operators are `+`, `-`, `*` (multiplication), `/` (division), `**` (power), `//` (integer division), `%` (division remainder). Python can perform operations according to the applicable mathematical rules (the use of parentheses is allowed). To read them, start the Jupyter notebook and enter the following expressions, each in separate cell (it is not necessary to use the `print` function - Jupyter will automatically print the result of the calculated expression):
6565

6666
```python
6767
1 + 2
@@ -134,7 +134,7 @@ All the constants of a specific type described above (as well as other types, no
134134
* tuples: `tuple`
135135

136136

137-
For any value you can check its type using the type function, for example:
137+
For any value you can check its type using the `type` function, for example:
138138

139139
```python
140140
type(2)

02 Constants, Variables and Basic Operations/4 User interaction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ nav_order: 4
66

77
# User interaction
88

9-
So far we have focused on the back-end part of the code (see [Kitchen and Dining Room](00%20Algorithms/3%20Frontend-backend)). In the simplest cases writing Python commands in a console or a Jupyter Notebook allows to see the result of the last evaluated expression. However, in full programs it does not work so. We need a way to interact with the user of our program. Later, when you have more experience, you may try to create some neat graphical user interface or use web pages for this purpose. However, for now we will stick with the simplest solution: the `print` and `input` functions.
9+
So far we have focused on the back-end part of the code (see [Kitchen and Dining Room](../00%20Algorithms/3%20Frontend-backend)). In the simplest cases writing Python commands in a console or a Jupyter Notebook allows to see the result of the last evaluated expression. However, in full programs it does not work so. We need a way to interact with the user of our program. Later, when you have more experience, you may try to create some neat graphical user interface or use web pages for this purpose. However, for now we will stick with the simplest solution: the `print` and `input` functions.
1010

1111
## `print` function
1212

03 Flow Control/1 Conditions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ nav_order: 1
88

99
All previous programs have been executed sequentially, line by line. No line could be skipped.
1010

11-
Consider the following problem: for a given real number, determine its absolute value. If number > 0, the program should print its value, otherwise it should print –number . This behavior cannot be achieved by using a sequential program. The program should conditionally select the next step. The following command used for this purpose is called if:
11+
Consider the following problem: for a given real number, determine its absolute value. If number > 0, the program should print its value, otherwise it should print –number . This behavior cannot be achieved by using a sequential program. The program should conditionally select the next step. The following command used for this purpose is called **`if`**:
1212

1313
```python
1414
number = float(input("Enter a number:"))
@@ -21,7 +21,7 @@ else:
2121
print(absolute_value)
2222
```
2323

24-
This program uses a conditional statement **`if`** . After that, we put a condition `number > 0` after a colon. We then insert a block of statements that will only be executed if the condition is true (i.e. the value of the expression `number > 0` is equal to `True`). This block can be followed by a word else, a colon, and another block of instructions that will only be executed if the condition is false (i.e., has the value `False`).
24+
This program uses a conditional statement **`if`** . After that, we put a condition `number > 0` after a colon. We then insert a block of statements that will only be executed if the condition is true (i.e. the value of the expression `number > 0` is equal to `True`). This block can (but doesn't have to) be followed by a word **`else`**, a colon, and another block of instructions that will only be executed if the condition is false (i.e., has the value `False`).
2525

2626
## Blocks in Python
2727

@@ -42,7 +42,7 @@ In summary, a conditional statement in Python has the following syntax:
4242
executed if the condition is False
4343
</pre>
4444

45-
the keyword else along with its corresponding block can be omitted if nothing should be done if the condition is false. For example, we can replace the variable with number with its absolute value as follows:
45+
the keyword `else` along with its corresponding block can be omitted if nothing should be done if the condition is false. For example, we can replace the variable with number with its absolute value as follows:
4646

4747
```python
4848
number = float(input("Enter a number:"))

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ source "https://rubygems.org"
33
#gem "github-pages", "~> 223", group: :jekyll_plugins
44
gem "github-pages", group: :jekyll_plugins
55
gem "webrick", "~> 1.7"
6+
gem "json"

Gemfile.lock

Lines changed: 49 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (7.1.2)
4+
activesupport (7.1.3.2)
55
base64
66
bigdecimal
77
concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -11,17 +11,17 @@ GEM
1111
minitest (>= 5.1)
1212
mutex_m
1313
tzinfo (~> 2.0)
14-
addressable (2.8.5)
14+
addressable (2.8.6)
1515
public_suffix (>= 2.0.2, < 6.0)
1616
base64 (0.2.0)
17-
bigdecimal (3.1.4)
17+
bigdecimal (3.1.6)
1818
coffee-script (2.4.1)
1919
coffee-script-source
2020
execjs
21-
coffee-script-source (1.11.1)
21+
coffee-script-source (1.12.2)
2222
colorator (1.1.0)
2323
commonmarker (0.23.10)
24-
concurrent-ruby (1.2.2)
24+
concurrent-ruby (1.2.3)
2525
connection_pool (2.4.1)
2626
dnsruby (1.70.0)
2727
simpleidn (~> 0.2.1)
@@ -34,24 +34,23 @@ GEM
3434
ffi (>= 1.15.0)
3535
eventmachine (1.2.7)
3636
execjs (2.9.1)
37-
faraday (2.7.11)
38-
base64
39-
faraday-net_http (>= 2.0, < 3.1)
40-
ruby2_keywords (>= 0.0.4)
41-
faraday-net_http (3.0.2)
37+
faraday (2.9.0)
38+
faraday-net_http (>= 2.0, < 3.2)
39+
faraday-net_http (3.1.0)
40+
net-http
4241
ffi (1.16.3)
4342
forwardable-extended (2.6.0)
44-
gemoji (3.0.1)
45-
github-pages (228)
46-
github-pages-health-check (= 1.17.9)
47-
jekyll (= 3.9.3)
48-
jekyll-avatar (= 0.7.0)
49-
jekyll-coffeescript (= 1.1.1)
43+
gemoji (4.1.0)
44+
github-pages (231)
45+
github-pages-health-check (= 1.18.2)
46+
jekyll (= 3.9.5)
47+
jekyll-avatar (= 0.8.0)
48+
jekyll-coffeescript (= 1.2.2)
5049
jekyll-commonmark-ghpages (= 0.4.0)
51-
jekyll-default-layout (= 0.1.4)
52-
jekyll-feed (= 0.15.1)
50+
jekyll-default-layout (= 0.1.5)
51+
jekyll-feed (= 0.17.0)
5352
jekyll-gist (= 1.5.0)
54-
jekyll-github-metadata (= 2.13.0)
53+
jekyll-github-metadata (= 2.16.1)
5554
jekyll-include-cache (= 0.2.1)
5655
jekyll-mentions (= 1.6.0)
5756
jekyll-optional-front-matter (= 0.3.2)
@@ -78,28 +77,28 @@ GEM
7877
jekyll-theme-tactile (= 0.2.0)
7978
jekyll-theme-time-machine (= 0.2.0)
8079
jekyll-titles-from-headings (= 0.5.3)
81-
jemoji (= 0.12.0)
82-
kramdown (= 2.3.2)
80+
jemoji (= 0.13.0)
81+
kramdown (= 2.4.0)
8382
kramdown-parser-gfm (= 1.1.0)
8483
liquid (= 4.0.4)
8584
mercenary (~> 0.3)
8685
minima (= 2.5.1)
8786
nokogiri (>= 1.13.6, < 2.0)
88-
rouge (= 3.26.0)
87+
rouge (= 3.30.0)
8988
terminal-table (~> 1.4)
90-
github-pages-health-check (1.17.9)
89+
github-pages-health-check (1.18.2)
9190
addressable (~> 2.3)
9291
dnsruby (~> 1.60)
93-
octokit (~> 4.0)
94-
public_suffix (>= 3.0, < 5.0)
92+
octokit (>= 4, < 8)
93+
public_suffix (>= 3.0, < 6.0)
9594
typhoeus (~> 1.3)
9695
html-pipeline (2.14.3)
9796
activesupport (>= 2)
9897
nokogiri (>= 1.4)
9998
http_parser.rb (0.8.0)
10099
i18n (1.14.1)
101100
concurrent-ruby (~> 1.0)
102-
jekyll (3.9.3)
101+
jekyll (3.9.5)
103102
addressable (~> 2.4)
104103
colorator (~> 1.0)
105104
em-websocket (~> 0.5)
@@ -112,27 +111,27 @@ GEM
112111
pathutil (~> 0.9)
113112
rouge (>= 1.7, < 4)
114113
safe_yaml (~> 1.0)
115-
jekyll-avatar (0.7.0)
114+
jekyll-avatar (0.8.0)
116115
jekyll (>= 3.0, < 5.0)
117-
jekyll-coffeescript (1.1.1)
116+
jekyll-coffeescript (1.2.2)
118117
coffee-script (~> 2.2)
119-
coffee-script-source (~> 1.11.1)
118+
coffee-script-source (~> 1.12)
120119
jekyll-commonmark (1.4.0)
121120
commonmarker (~> 0.22)
122121
jekyll-commonmark-ghpages (0.4.0)
123122
commonmarker (~> 0.23.7)
124123
jekyll (~> 3.9.0)
125124
jekyll-commonmark (~> 1.4.0)
126125
rouge (>= 2.0, < 5.0)
127-
jekyll-default-layout (0.1.4)
128-
jekyll (~> 3.0)
129-
jekyll-feed (0.15.1)
126+
jekyll-default-layout (0.1.5)
127+
jekyll (>= 3.0, < 5.0)
128+
jekyll-feed (0.17.0)
130129
jekyll (>= 3.7, < 5.0)
131130
jekyll-gist (1.5.0)
132131
octokit (~> 4.2)
133-
jekyll-github-metadata (2.13.0)
132+
jekyll-github-metadata (2.16.1)
134133
jekyll (>= 3.4, < 5.0)
135-
octokit (~> 4.0, != 4.4.0)
134+
octokit (>= 4, < 7, != 4.4.0)
136135
jekyll-include-cache (0.2.1)
137136
jekyll (>= 3.7, < 5.0)
138137
jekyll-mentions (1.6.0)
@@ -203,16 +202,17 @@ GEM
203202
jekyll (>= 3.3, < 5.0)
204203
jekyll-watch (2.2.1)
205204
listen (~> 3.0)
206-
jemoji (0.12.0)
207-
gemoji (~> 3.0)
205+
jemoji (0.13.0)
206+
gemoji (>= 3, < 5)
208207
html-pipeline (~> 2.2)
209208
jekyll (>= 3.0, < 5.0)
210-
kramdown (2.3.2)
209+
json (2.7.1)
210+
kramdown (2.4.0)
211211
rexml
212212
kramdown-parser-gfm (1.1.0)
213213
kramdown (~> 2.0)
214214
liquid (4.0.4)
215-
listen (3.8.0)
215+
listen (3.9.0)
216216
rb-fsevent (~> 0.10, >= 0.10.3)
217217
rb-inotify (~> 0.9, >= 0.9.10)
218218
mercenary (0.3.6)
@@ -221,23 +221,25 @@ GEM
221221
jekyll (>= 3.5, < 5.0)
222222
jekyll-feed (~> 0.9)
223223
jekyll-seo-tag (~> 2.1)
224-
minitest (5.20.0)
224+
minitest (5.22.2)
225225
mutex_m (0.2.0)
226-
nokogiri (1.15.4)
226+
net-http (0.4.1)
227+
uri
228+
nokogiri (1.16.2)
227229
mini_portile2 (~> 2.8.2)
228230
racc (~> 1.4)
229231
octokit (4.25.1)
230232
faraday (>= 1, < 3)
231233
sawyer (~> 0.9)
232234
pathutil (0.16.2)
233235
forwardable-extended (~> 2.6)
234-
public_suffix (4.0.7)
236+
public_suffix (5.0.4)
235237
racc (1.7.3)
236238
rb-fsevent (0.11.2)
237239
rb-inotify (0.10.1)
238240
ffi (~> 1.0)
239241
rexml (3.2.6)
240-
rouge (3.26.0)
242+
rouge (3.30.0)
241243
ruby2_keywords (0.0.5)
242244
rubyzip (2.3.2)
243245
safe_yaml (1.0.5)
@@ -253,22 +255,24 @@ GEM
253255
unf (~> 0.1.4)
254256
terminal-table (1.8.0)
255257
unicode-display_width (~> 1.1, >= 1.1.1)
256-
typhoeus (1.4.0)
258+
typhoeus (1.4.1)
257259
ethon (>= 0.9.0)
258260
tzinfo (2.0.6)
259261
concurrent-ruby (~> 1.0)
260262
unf (0.1.4)
261263
unf_ext
262-
unf_ext (0.0.9)
264+
unf_ext (0.0.9.1)
263265
unicode-display_width (1.8.0)
266+
uri (0.13.0)
264267
webrick (1.8.1)
265268

266269
PLATFORMS
267270
ruby
268271

269272
DEPENDENCIES
270273
github-pages
274+
json
271275
webrick (~> 1.7)
272276

273277
BUNDLED WITH
274-
2.4.20
278+
2.5.4

0 commit comments

Comments
 (0)