10000 small changes + extra resources · georgecms/complete-python-course@18711f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 18711f9

Browse files
committed
small changes + extra resources
1 parent 38c5dcb commit 18711f9

File tree

4 files changed

+64
-25
lines changed

4 files changed

+64
-25
lines changed

course_contents/1_intro/notes/01. Data Types.md

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
### Variables
2-
- A variable is a symbolic type associated with a value.
2+
- A variable is a name associated with a value.
33
- A variable can be named anything, but it has some rules:
44
1. It cannot start with an integer
55
2. It cannot contain spaces
@@ -24,6 +24,10 @@ Examples of variable names:
2424
`$current`
2525
`response#`
2626

27+
**Extra resources**
28+
29+
- [What are variables?](https://python.tecladocode.com/1_age_program/2_variables.html#what-are-variables)
30+
2731
### Strings
2832
A string is a sequence of characters surrounded by quotation marks:
2933
- Single quotes `''`
@@ -54,7 +58,13 @@ Examples:
5458

5559
`"Same as this one'`
5660

57-
61+
**Extra resources**
62+
- [Strings and numbers](https://python.tecladocode.com/1_age_program/1_strings_numbers.html)
63+
- [String formatting](https://python.tecladocode.com/1_age_program/4_string_formatting.html#what-is-string-formatting)
64+
- [Strings, Variables, and Getting Input from Users](https://www.teclado.com/30-days-of-python/python-30-day-2-strings-variables)
65+
- [Formatting Strings and Processing User Input](https://www.teclado.com/30-days-of-python/python-30-day-3-string-formatting)
66+
- [Formatting Numbers for Printing in Python](https://blog.teclado.com/python-formatting-numbers-for-printing/)
67+
- [Nested String Interpolation in Python](https://blog.teclado.com/python-nested-string-interpolation/)
5868

5969
### Integers
6070
An integer is a whole number of any length that can be positive or negative, written without a fractional element.
@@ -63,31 +73,26 @@ Example:
6373

6474
`-1` `0` `1` `2` `3` `86400`
6575

76+
6677
### Floats
6778
A float is a number that can be positive or negative written with a fractional element.
6879

6980
Example:
7081

7182
`-100.54` `1.0` `59.1` `10.99`
7283

73-
### Booleans
74-
Computers only understand binary — `1's` and `0's`.
84+
**Extra resources**
85+
- [Numbers, Arithmetic, and Printing to the Console](https://www.teclado.com/30-days-of-python/python-30-day-1-numbers-printing)
7586

76-
This way we can determine if a value is `True` or `False`.
87+
### Booleans
88+
In Python booleans are a bool data type having two values:
7789

78-
Strings, integers and other data types can indicate a boolean value.
90+
`True`
7991

80-
Data types representing False bool:
81-
- Empty string: `''`
82-
- Empty list: `[]`
83-
- Zero int: `0`
84-
- Zero float: `'0.0'`
92+
`False`
8593

86-
Data types representing True bool:
87-
- A non-empty string: `"This string"`
88-
- A list populated with at least one element: `[100, 55]`
89-
- An integer higher than zero: `1`
90-
- A float of which decimal number is higher than zero: `0.1`
94+
**Extra resources**
95+
- [Conditionals and Booleans](https://www.teclado.com/30-days-of-python/python-30-day-5-conditionals-booleans)
9196

9297
### Lists
9398
- A list is an ordered sequential data type
@@ -110,7 +115,10 @@ Data types representing True bool:
110115

111116
`shopping_list[2] # cherries`
112117

113-
118+
**Extra resources**
119+
- [What is a list?](https://python.tecladocode.com/2_countries_visited/1_lists.html)
120+
- [Split, join, and slices](https://www.teclado.com/30-days-of-python/python-30-day-7-split-join)
121+
- [Extending Python Lists](https://blog.teclado.com/python-extending-lists/)
114122

115123
### Tuples
116124
- A tuple is very much like a list, however:
@@ -128,13 +136,20 @@ Example:
128136

129137
`better_readability = ('with', 'parenthesis')`
130138

139+
**Extra resources**
140+
- [Basic Python Collections](https://www.teclado.com/30-days-of-python/python-30-day-4-lists-tuples)
141+
131142
### Sets
132143
- A set is an **unordered** data type
133144
- Elements of a set cannot be accessed by their indices
134145
- A set is created by a single pair of curly brackets:
135146

136147
`shopping_list = {'apples', 'milk', 'cherries'}`
137148

149+
**Extra resources**
150+
- [Sets](https://www.teclado.com/30-days-of-python/python-30-day-11-sets)
151+
- [Python Set Operators](https://blog.teclado.com/python-set-operators/)
152+
138153
### Dictionaries
139154
- A dictionary is created by 3 key components:
140155
curly braces, keys and values
@@ -147,4 +162,8 @@ employees = {'ID': 16915, 'name': 'James', 'department': ['Sales', 'Accounting']
147162
```
148163

149164
- A dictionary is accessed by keys as such:
150-
`employees['name'] # 'James'`
165+
`employees['name'] # 'James'`
166+
167+
**Extra resources**
168+
- [What is a dictionary?](https://python.tecladocode.com/2_countries_visited/1_lists.html)
169+
- [Updating Python Dictionaries](https://blog.teclado.com/python-updating-dictionaries/)

course_contents/1_intro/notes/02. Arithmetic Operators.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Correct uses:
55
- The use with strings (concatenation):
66
`"My name is " + "James"`
77

8-
Wrong uses:
8+
Incorrect uses:
99
- Between strings and integers/floats:
1010
`"The correct number is" + 5`
1111
`TypeError: can only concatenate str (not "int") to str`
@@ -14,6 +14,14 @@ Wrong uses:
1414
- The use between integers/floats:
1515
`93.1 - 50`
1616

17+
- The use between sets (return elements of set_1 that aren't in set_2):
18+
```python
19+
set_1 = {3, 6, 9, 7, 5}
20+
set_2 = {3, 6, 9, 95}
21+
22+
set_difference = set_1 - set_2 # {5, 7}
23+
```
24+
1725
## Multiplication `*`
1826
- The arithmetic use:
1927
`8 * 5`
@@ -36,7 +44,7 @@ Example:
3644
`55 // 3`
3745

3846
## Modulo `%`
39-
- Based on the Euclidean division
47+
- It's based on the Euclidean division ([learn more](https://blog.teclado.com/pythons-modulo-operator-and-floor-division/))
4048
- Start with a **dividend** and a **divisor**
4149
- It's used to get the remainder between the two operands
4250

@@ -47,3 +55,9 @@ The result for `10 % 3` is `1`.
4755

4856
## Exponentiation `**`
4957
`2 ** 3` Can be read as: 2 raised to the power of 3, same as `2 * 2 * 2`.
58+
59+
60+
## Extra resources
61+
- [How do mathematics work in Python?](https://python.tecladocode.com/1_age_program/1_strings_numbers.html#how-do-mathematics-work-in-python)
62+
- [Python's modulo operator and floor division](https://blog.teclado.com/pythons-modulo-operator-and-floor-division/)
63+
- [Python's divmod Function](https://blog.teclado.com/pythons-divmod-function/)

course_contents/1_intro/notes/03. Comparison Operators.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,7 @@ Each comparison operator returns True or False
4141
`10 >= 10 # True`
4242

4343
### Less than or equal to `<=`
44-
`10 <= 10 # True`
44+
`10 <= 10 # True`
45+
46+
### Extra resources
47+
- [Conditionals and Booleans](https://www.teclado.com/30-days-of-python/python-30-day-5-conditionals-booleans)

course_contents/1_intro/notes/05. Logical Operators.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## AND
2-
- Returns True if both operands are true
2+
- `and` returns the first value if it evaluates to false, otherwise it returns the second value.
33

44
Example:
55

@@ -12,8 +12,7 @@ Example:
1212

1313

1414
## OR
15-
- Returns True if at least one operand is True
16-
- Reads from the left to the right operand
15+
- `or` returns the first value if it evaluates to true, otherwise it returns the second value.
1716

1817
Example:
1918

@@ -25,11 +24,15 @@ Example:
2524
| `False or True` | `True` |
2625

2726
## NOT
28-
- Returns True if the operand is False
27+
- `not` returns True if the operand is False
2928

3029
Example:
3130

3231
| Statement | Result |
3332
| ------------- | ---------- |
3433
| `not True` | `False` |
3534
| `not False` | `True` |
35+
36+
37+
### Extra resources
38+
- [Logical comparisons in Python: and & or](https://blog.teclado.com/logical-comparisons-in-python-and-or/)

0 commit comments

Comments
 (0)
0