Skip to content

Commit 41a57a6

Browse files
Merge branch 'master' into bits-bytes-hexadecimals
2 parents 646836f + 1d10ade commit 41a57a6

File tree

109 files changed

+495
-541
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+495
-541
lines changed

CHANGELOG.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,27 @@ Types of change:
4848

4949
### Fixed
5050

51+
## January 25th 2022
52+
53+
### Added
54+
- [TypeScript - tsc Extending Interfaces - Add more info](https://github.com/enkidevs/curriculum/pull/3029)
55+
56+
### Archived
57+
- [Git - Remote Repository - Tracking and staging files duplicate](https://github.com/enkidevs/curriculum/pull/2970)
58+
59+
## January 24th 2022
60+
61+
### Changed
62+
- [Go - For Loops - Make the question fill in the gap only](https://github.com/enkidevs/curriculum/pull/3030)
63+
64+
### Fixed
65+
- [HTML - List Orders - Remove extra answer field from RQ](https://github.com/enkidevs/curriculum/pull/3031)
66+
67+
## January 10th 2022
68+
69+
### Fixed
70+
- [Python - Set Comprehension - More corrent answer to appropriate place in RQ](https://github.com/enkidevs/curriculum/pull/2987)
71+
5172
## January 9th 2022
5273

5374
### Changed
@@ -56,13 +77,48 @@ Types of change:
5677
## January 5th 2022
5778

5879
### Fixed
80+
- [HTML - Image Base - Add mising example using OpenGraph meta tag](https://github.com/enkidevs/curriculum/pull/2984)
5981
- [Git - Move The Last Commit To A New Branch - Add missing answer fields and improve wording of PQ](https://github.com/enkidevs/curriculum/pull/2983)
6082
- [Java - Multithreading Use Local Variables - Fix example](https://github.com/enkidevs/curriculum/pull/2982)
6183

6284
### Changed
6385
- [Html - Link Relative Paths - Change part of PQ as it wasn't worder properly](https://github.com/enkidevs/curriculum/pull/2985)
6486
- [Python - Format Text Paragraphs With Textwrap - Make the fill method more clear](https://github.com/enkidevs/curriculum/pull/2981)
6587
- [Python - Bits Bytes Hexadecimals - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/2991)
88+
- [Python - Python Recipes - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3009)
89+
- [Python - Is Your Python Healthy - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/2999)
90+
- [Python - Memory Allocation - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces, grammar improvements](https://github.com/enkidevs/curriculum/pull/3002)
91+
- [Python - Playing With Time - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3007)
92+
- [Python - Deep Into Collections - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/2997)
93+
- [Python - Python Functions - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3008)
94+
- [Python - Control Flow II - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/2996)
95+
- [Python - Control Flow I - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/2995)
96+
- [Python - Intro To Modules - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/2998)
97+
- [Python - Classes II - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/2993)
98+
- [Python - More On Dictionaries - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3004)
99+
- [Python - Math Recipies - Minor grammar improvement](https://github.com/enkidevs/curriculum/pull/3001)
100+
- [Python - More On Lists - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3005)
101+
- [Python - Classes I - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/2992)
102+
- [Python - Looping - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3000)
103+
- [Python - Meet Python - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3003)
104+
- [Python - Python Tips - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3010)
105+
- [Python - Sequential Data Types II - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3012)
106+
- [Python - Decorators - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3023)
107+
- [Python - Functional Programming II - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3025)
108+
- [Python - String Recipes - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3013)
109+
- [Python - Syntax And Numerical Operators - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3014)
110+
- [Python - Testing - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3015)
111+
- [Python - Unordered Data Types - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3016)
112+
- [Python - Utilities I - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3017)
113+
- [Python - Utilities II - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3018)
114+
- [Python - Working With Strings - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3019)
115+
- [Python - Arrays I - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3020)
116+
- [Python - Arrays II - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3021)
117+
- [Python - Comprehension - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3022)
118+
- [Python - Functional Programming - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3024)
119+
- [Python - Generators - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3026)
120+
- [Python - Python Immutability - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3028)
121+
- [Python - Iterators - Move single-line commands to a single line, update indentation in codeblocks from 4 to 2 spaces](https://github.com/enkidevs/curriculum/pull/3027)
66122

67123
## January 4th 2022
68124

git/essentials/remote-repository/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ description: Learn the in's and out's of git's remote repository.
33
insights:
44
- introduction-to-remote-repositories
55
- working-with-remotes
6-
- tracking-and-staging-files
76
- merging
87
- pushing
98
game: git-erminology

go/go-introduction/for-and-switch/go-for-loops.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ category: how-to
55
practiceQuestion:
66
formats:
77
- fill-in-the-gap
8-
- type-in-the-gap
98
context: standalone
109
revisionQuestion:
1110
formats:

python/functional-programming/arrays-i/the-reversed-built-in-function.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ The `reversed` built-in allows us to create an iterator for an iterable sequence
3131
reversed(seq)
3232
```
3333

34-
Where `seq` is an iterable sequence such as a tuple, list, string or range. This returns an iterator which accesses the elements in the sequence in the reverse order. For example, we may use `reversed` to reverse the order of characters in a string.
34+
Where `seq` is an iterable sequence such as a tuple, list, string, or range. This returns an iterator, which accesses the elements in the sequence in the reverse order. For example, we may use `reversed` to reverse the order of characters in a string.
3535

3636
```python
3737
ourString = 'enki'
3838
print(list(reversed(ourString)))
3939
# Result: ['i', 'k', 'n', 'e']
4040
```
4141

42-
Notice how we could create custom classes that implement the `__reversed__()` method and then use `reversed` on them to quickly and efficiently reverse their ordering. In this way we can begin to see how often the `reversed` function might be useful in day-to-day programming tasks.
42+
Notice how we could create custom classes that implement the `__reversed__()` method and then use `reversed` on them to quickly and efficiently reverse their ordering. In this way, we can begin to see how often the `reversed` function might be useful in day-to-day programming tasks.
4343

4444

4545
---

python/functional-programming/arrays-i/the-slice-built-in-function.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ print(ourString[sObject])
105105
Use `slice` to remove every second number in the list of numbers.
106106

107107
```python
108-
nList = ['1', '2', '3', '4', '5',
109-
'6', '7', '8']
108+
nList = ['1', '2', '3', '4', '5', '6', '7', '8']
110109

111110
sObject = ???(???, ???, ???)
112111
print(nList[sObject])

python/functional-programming/arrays-i/the-zip-built-in-function.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,9 @@ We have three lists, `fnames`, `lnames`, `locations`, which are ordered so that
105105
Fill in the gaps in the code below to achieve this.
106106

107107
```python
108-
locations = ['IT',
109-
'FR',
110-
'FR',
111-
'RU']
112-
fnames = ['italo',
113-
'jean',
114-
'emily',
115-
'katya']
116-
lnames = ['calvino',
117-
'micheal',
118-
'rambert',
119-
'sokolov']
108+
locations = ['IT', 'FR', 'FR', 'RU']
109+
fnames = ['italo', 'jean', 'emily', 'katya']
110+
lnames = ['calvino', 'micheal', 'rambert', 'sokolov']
120111

121112
result = zip(???, ???)
122113
result2 = zip(???, ???)

python/functional-programming/arrays-ii/the-map-built-in-function.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ revisionQuestion:
2929

3030
## Content
3131

32-
The `map` function is built in to the Python language. Together with the other built-in functions `filter` and `reduce`, `map` allows us to take a functional approach to programming in Python.
32+
The `map` function is built into the Python language. Together with the other built-in functions `filter` and `reduce`, `map` allows us to take a functional approach to programming in Python.
3333

3434
`map` applies a given function—`function_here` in the case below—iteratively to all items in a given `input_list`[1]. The basic syntax looks like this:
3535

@@ -68,8 +68,7 @@ Finally, it's good to know that we can pass more than one iterable `input_list`
6868
Let's say we have a list, called `promises`. We want to `make_good` on all our promises, where `make_good` is a previously-defined function that takes a string. Fill in the blanks in the code below to apply `make_good` to all elements in `promises`.
6969

7070
```python
71-
promises = ['learn css', 'learn js',
72-
'buy milk', 'be excellent to each other']
71+
promises = ['learn css', 'learn js', 'buy milk', 'be excellent to each other']
7372
promises = ???(???, ???)
7473
```
7574

python/functional-programming/arrays-ii/the-sorted-built-in-function.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ print(sorted([4, 0, 2, 3, 1, 5]))
105105
What is the result of the execution of the following code snippet?
106106

107107
```python
108-
print(sorted([0, 2, 3, 1,
109-
'a', 'b', 'A', 'B']))
108+
print(sorted([0, 2, 3, 1, 'a', 'b', 'A', 'B']))
110109
```
111110

112111
???

python/functional-programming/comprehension/dictionary-comprehension.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ cube_dict = {x: x ** 3 for x in num_list}
3434

3535
```
3636

37-
Now if we print cube_dict, we get:
37+
Now, if we print `cube_dict`, we get:
3838

3939
```python
4040
for k, v in cube_dict.items():
41-
print(k, v)
41+
print(k, v)
4242
# output
4343
# 1 1
4444
# 2 8
@@ -58,17 +58,18 @@ print(lcase_freqs)
5858
# partial output ...
5959

6060
{'u': 0, 'q': 0, 'w': 0, 'o': 0, \
61-
'b': 0, 'c': 0, 't': 0, 'h': 0, \
61+
'b': 0, 'c': 0, 't': 0, 'h': 0, \
6262
...
63-
'g': 0, 'a': 0, 'n': 0}
63+
'g': 0, 'a': 0, 'n': 0}
64+
6465
# Check it is correct:
6566
lfk = list(lcase_freqs.keys())
6667
lfk.sort()
6768
print(lfk)
6869
['a', 'b', 'c', 'd', 'e', 'f', \
69-
'g', 'h', 'i', 'j', 'k', 'l', \
70-
'm', 'n', 'o', 'p','q', 'r', \
71-
's', 't', 'u', 'v', 'w', 'x', \
72-
'y', 'z']
70+
'g', 'h', 'i', 'j', 'k', 'l', \
71+
'm', 'n', 'o', 'p','q', 'r', \
72+
's', 't', 'u', 'v', 'w', 'x', \
73+
'y', 'z']
7374

7475
```

python/functional-programming/comprehension/list-comprehension.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ Use list comprehension to add one and divide by two [(x + 1) / 2] for all elemen
9797

9898
```python
9999
l = [1,2,3,4,5]
100-
x = [((x+1)/2) ??? x % 2 \
101-
??? x ??? x in ???]
100+
x = [((x+1)/2) ??? x % 2 ??? x ??? x in ???]
102101
```
103102

104103
- if

python/functional-programming/comprehension/nested-lists-comprehension.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,23 @@ Since a list comprehension can take any **expression** as its initial expression
2727
These are often useful, but are often used to work with matrices.
2828

2929
```python
30-
matrix = [[1, 2, 3], [4, 5, 6], \
31-
[7, 8, 9]]
32-
30+
matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
3331
```
3432

3533
Say we want to create another matrix with values equal to the squares of each element in the original matrix:
3634

3735
```python
38-
matrix2 = [[x**2 for x in row] for \
39-
row in matrix]
40-
#matrix2 = [[1, 4, 9], [16, 25, 36],\
41-
# [49, 64, 81]]
36+
matrix2 = [[x**2 for x in row] for row in matrix]
37+
#matrix2 = [[1, 4, 9], [16, 25, 36], [49, 64, 81]]
4238
```
4339

4440
A more advanced list comprehension with two for clauses and two if clauses:
4541

4642
```python
4743
lc = [ (x, y) for x in \
48-
range(10) if x % 2 == 0 \
49-
for y in range(20) if \
50-
y % 3 == 0 ]
44+
range(10) if x % 2 == 0 \
45+
for y in range(20) if \
46+
y % 3 == 0 ]
5147
# lc
5248
# [(0, 0), (0, 3), (0, 6), \
5349
# (0, 9), (0, 12), (0, 15), (0, 18),\
@@ -70,7 +66,6 @@ Use nested list comprehension to generate a list of tuples, where the first elem
7066
Ex: (1,1),(1,2),(1,3),...(9,7),(9,8),(9,9).
7167

7268
```python
73-
7469
l = [??? for x in range(10)\
7570
if ??? for y in ???]
7671
```

python/functional-programming/comprehension/set-comprehension.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,19 @@ Imagine we have the following list:
3333

3434
```python
3535
my_list = [1, 2, 3, 4, 5, 6, 7, 8]
36-
3736
```
3837

3938
And we need a set containing only even numbers in the list. This can be easily achieved with **set comprehension**:
4039

4140
```python
4241
even_set = {x for x in my_list if x%2 == 0}
43-
4442
```
4543

4644
We can now check the result:
4745

4846
```python
4947
print(even_set)
5048
# {8, 2, 4, 6}
51-
5249
```
5350

5451
Note that the above operation would work even if my_list contained some duplicate values, e.g:
@@ -67,10 +64,8 @@ since sets by definition do not allow duplicates.
6764
Fill in the following code snippet. It creates a new set that contains elements of list `l` that are even and adds one and divides by two the odd numbers:
6865

6966
```python
70-
7167
l = [10, 11, 13, 14, 18, 19]
72-
new_set = {x ??? x % 2 == 0 else/
73-
??? for x ??? l}
68+
new_set = {x ??? x % 2 == 0 else ??? for x ??? l}
7469
```
7570

7671
- if
@@ -88,15 +83,14 @@ new_set = {x ??? x % 2 == 0 else/
8883
What will the `odd_set` look like after we run the following code snippet?
8984

9085
```python
91-
9286
l = [1,3,3,2,4,5,5,8,9]
9387
odd_set = {x for x in l if x % 2}
9488
```
9589

9690
???
9791

98-
- {1,3,3,5,5,9}
9992
- {1,3,5,9}
93+
- {1,3,3,5,5,9}
10094
- {1,2,3,4,5,8,9}
10195
- {2,4,8}
10296

python/functional-programming/comprehension/speed-up-your-for-loop-using-map-or-list-comprehensions.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ If you need to lowercase all the input strings:
3535
```python
3636
lower_list = []
3737
for word in input_list:
38-
lower_list.append(word.lower())
38+
lower_list.append(word.lower())
3939
```
4040

4141
Instead, you can use `map()` to push the loop into compiled C code:
@@ -47,8 +47,7 @@ lower_list = map(str.lower, input_list)
4747
Also, in Python 2.0 or above, there are list comprehensions. List comprehension are the "pythonic" way to approach this situation. `map()` is more often used in JavaScript. We recommend usage of list comprehension:
4848

4949
```python
50-
lower_list = [word.lower() \
51-
for word in input_list]
50+
lower_list = [word.lower() for word in input_list]
5251
```
5352

5453
They are both more efficient than simple `for` loop statement.
@@ -63,8 +62,7 @@ Use list comprehension to modify a list of characters such that all its elements
6362
```python
6463
strings = ['a', 'e', 'i', 'o', 'u']
6564

66-
lower_list = [word.??? \
67-
for word in ???]
65+
lower_list = [word.??? for word in ???]
6866
```
6967

7068
- upper()

python/functional-programming/decorators/decorators-methods.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ def get_fahrenheit(method):
3232
# methods, pass self as a parameter
3333
def wrapper(self):
3434
# "self" argument is passed
35-
return "{0} F"
36-
.format(method(self) * 1.8 + 32)
35+
return "{0} F".format(method(self) * 1.8 + 32)
3736
return wrapper
3837

3938
class Temperature(object):
@@ -55,8 +54,7 @@ We got it now working for methods. But what if we are looking to decorate method
5554
def get_fahrenheit(method):
5655
# exepect any number of args/named args
5756
def wrapper(*args, **kwargs):
58-
return "{0} F"
59-
.format(method(*args,**kwargs)*1.8+32)
57+
return "{0} F".format(method(*args,**kwargs)*1.8+32)
6058
return wrapper
6159

6260
class Temperature(object):
@@ -65,10 +63,8 @@ class Temperature(object):
6563

6664
@get_fahrenheit
6765
#two extra arguments expected here
68-
def get_temp(self, extra1, extra2 = 0,
69-
extra3 = 0):
70-
return self.degrees + extra1 + extra2
71-
+ extra3
66+
def get_temp(self, extra1, extra2 = 0, extra3 = 0):
67+
return self.degrees + extra1 + extra2 + extra3
7268
temp = Temperature(15)
7369
# self is passed by default
7470
print(temp.get_temp(3, extra2 = 1))

0 commit comments

Comments
 (0)