8000 Revert "update" · VixyMan/complete-python-course@60e7294 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit 60e7294

Browse files
committed
Revert "update"
This reverts commit ec73970. update
1 parent e230a34 commit 60e7294

File tree

5 files changed

+77
-116
lines changed

5 files changed

+77
-116
lines changed

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

Lines changed: 47 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,62 +6,57 @@
66
3. It can only contain a symbol, which is the underscore
77

88
Examples of variable names:
9-
109
- Correct:
11-
12-
```
13-
response
14-
top500
15-
one_apple
16-
first_numbers
17-
_usernames
18-
_last_
19-
current_
20-
```
10+
`response`
11+
`top500`
12+
`one_apple`
13+
`first_numbers`
14+
`_usernames`
15+
`_last_`
16+
`current_`
2117

2218

2319
- Incorrect:
24-
25-
```
26-
top 500
27-
one apple
28-
1st_numbers
29-
^last_
30-
$current
31-
response#
32-
```
20+
`top 500`
21+
`one apple`
22+
`1st_numbers`
23+
`^last_`
24+
`$current`
25+
`response#`
3326

3427
**Extra resources**
3528

3629
- [What are variables?](https://python.tecladocode.com/1_age_program/2_variables.html#what-are-variables)
3730

3831
### Strings
3932
A string is a sequence of characters surrounded by quotation marks:
40-
Single quotes `''` or Double quotes `""`
33+
- Single quotes `''`
34+
or
35+
- Double quotes `""`
4136

4237

4338
- Anything surrounded by the quotation marks indicate a string
4439
- Every opening quote must have a closing quote to form a string
4540
- If opening a string with a single quote, the closing quote must be a single quote as well
4641

4742
Examples:
48-
4943
- Correct:
5044

51-
```python
52-
"This is a sample string using double quotes"
53-
'This is a sample string using single quotes'
54-
'This is a normal string'
55-
'50 + 51'
56-
```
45+
`"This is a sample string using double quotes"`
46+
47+
`'This is a sample string using single quotes'`
48+
49+
`'This is a normal string'`
50+
51+
`'50 + 51'`
5752

5853
- Incorrect:
5954

60-
```python
61-
'This string will end here.' From here the continuation is not a string'
62-
'This is an Incorrect string"
63-
"Same as this one'
64-
```
55+
`'This string will end here.' From here the continuation is not a string'`
56+
57+
`'This is an Incorrect string"`
58+
59+
`"Same as this one'`
6560

6661
**Extra resources**
6762
- [Strings and numbers](https://python.tecladocode.com/1_age_program/1_strings_numbers.html)
@@ -92,36 +87,33 @@ Example:
9287
### Booleans
9388
In Python booleans are a bool data type having two values:
9489

95-
```python
96-
True
97-
False
98-
```
90+
`True`
91+
92+
`False`
9993

10094
**Extra resources**
10195
- [Conditionals and Booleans](https://www.teclado.com/30-days-of-python/python-30-day-5-conditionals-booleans)
10296

10397
### Lists
104-
10598
- A list is an ordered sequential data type
10699
- A list is used to store multiple elements in one place
107100
- A list is created by a pair of square brackets
108101

109-
```python
110-
shopping_list = ['cereals', 'milk', 'cherries']
111-
midterm_grades = [4, 9, 6, 6]
112-
```
102+
`shopping_list = ['cereals', 'milk', 'cherries']`
103+
104+
`midterm_grades = [4, 9, 6, 6]`
113105

114106
- A list can contain different data types
115107

116108
`phone_numbers = ['james', 8067366796]`
117109

118110
- Each element in a list holds a position (index) through which it can be accessed
119111

120-
```python
121-
shopping_list[0] # cereals
122-
shopping_list[1] # milk
123-
shopping_list[2] # cherries
124-
```
112+
`shopping_list[0] # cereals`
113+
114+
`shopping_list[1] # milk`
115+
116+
`shopping_list[2] # cherries`
125117

126118
**Extra resources**
127119
- [What is a list?](https://python.tecladocode.com/2_countries_visited/1_lists.html)
@@ -136,12 +128,13 @@ shopping_list[2] # cherries
136128

137129
Example:
138130

139-
```python
140-
shopping_list = 'apples', 'milk', 'cherries'
141-
midterm_grades = 4, 9, 6, 6
142-
phone_numbers = 'james', 8067366796
143-
better_readability = ('with', 'parenthesis')
144-
```
131+
`shopping_list = 'apples', 'milk', 'cherries'`
132+
133+
`midterm_grades = 4, 9, 6, 6`
134+
135+
`phone_numbers = 'james', 8067366796`
136+
137+
`better_readability = ('with', 'parenthesis')`
145138

146139
**Extra resources**
147140
- [Basic Python Collections](https://www.teclado.com/30-days-of-python/python-30-day-4-lists-tuples)
@@ -164,17 +157,8 @@ curly braces, keys and values
164157
- The values can be any other data type
165158

166159
Example:
167-
168-
```python
169-
employees = {'ID': 16915, 'name': 'James', 'department': ['Sales', 'Accounting']}
170160
```
171-
172-
```python
173-
employees = {
174-
'ID': 16915,
175-
'name': 'James',
176-
'department': ['Sales', 'Accounting']
177-
}
161+
employees = {'ID': 16915, 'name': 'James', 'department': ['Sales', 'Accounting']}
178162
```
179163

180164
- A dictionary is accessed by keys as such:

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

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,20 @@
11
## Addition `+`
2-
32
Correct uses:
4-
53
- The use with integers and floats:
6-
74
`44 + 19.5 # 63.5`
8-
95
- The use with strings (concatenation):
10-
116
`"My name is " + "James"`
127

138
Incorrect uses:
14-
159
- Between strings and integers/floats:
16-
17-
```python
18-
"The correct number is" + 5
19-
# TypeError: can only concatenate str (not "int") to str
20 F987 -
```
10+
`"The correct number is" + 5`
11+
`TypeError: can only concatenate str (not "int") to str`
2112

2213
## Subtraction `-`
23-
2414
- The use between integers/floats:
25-
2615
`93.1 - 50`
2716

2817
- The use between sets (return elements of set_1 that aren't in set_2):
29-
3018
```python
3119
set_1 = {3, 6, 9, 7, 5}
3220
set_2 = {3, 6, 9, 95}
@@ -35,35 +23,27 @@ set_difference = set_1 - set_2 # {5, 7}
3523
```
3624

3725
## Multiplication `*`
38-
3926
- The arithmetic use:
40-
4127
`8 * 5`
4228

4329
- Multiplying data types:
44-
45-
```python
46-
"Hello " * 2 # Hello Hello
47-
[100] * 2 # [100, 100]
48-
(100, 1) * 2 # (100, 1, 100, 1)
49-
```
50-
30+
`"Hello " * 2 # Hello Hello `
31+
`[100] * 2 # [100, 100]`
32+
`(100, 1) * 2 # (100, 1, 100, 1)`
5133

5234
## True Division `/`
5335
- The two operands will always result in a float using the `/` operator
5436

5537
Example:
56-
57-
`30.5 / 2` will result `15.5`
38+
`40 / 2` will result `20.0`
5839

5940
## Floor Division `//`
60-
- Will always round the amount to the closest tenth
41+
- Will always round the amount to the closest tenth and result in an integer
6142

6243
Example:
63-
`30.5 // 2` will result `15.0`
44+
`55 // 3`
6445

6546
## Modulo `%`
66-
6747
- It's based on the Euclidean division ([learn more](https://blog.teclado.com/pythons-modulo-operator-and-floor-division/))
6848
- Start with a **dividend** and a **divisor**
6949
- It's used to get the remainder between the two operands

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

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
Each comparison operator returns True or False
22
### Equal `==`
33

4-
```python
5-
4 == 4 # True
6-
4 == 5 # False
7-
```
4+
`4 == 4 # True`
5+
6+
`4 == 5 # False`
87

98
- Can be used to check the truth value of an operand:
109

11-
```python
12-
4 is True # True
13-
4 is False # False
14-
0 is False # True
15-
```
10+
`4 is True # True`
11+
12+
`4 is False # False`
13+
14+
`0 is False # True`
1615

1716
- Can be used to compare two strings or any other data type:
1817

19-
```python
20-
"Hello" == "Hello" # True
21-
"Hello" == "HELLO" # False
22-
(100, 50) == 50 # False
23-
(100, 50) == (500, 219) # False
24-
```
18+
`"Hello" == "Hello" # True`
19+
20+
`"Hello" == "HELLO" # False`
21+
22+
`(100, 50) == 50 # False`
23+
24+
`(100, 50) == (500, 219) # False`
2525

2626
### Not equal `!=`
2727
- The opposite of `==`
2828

29-
```python
30-
4 != 4 # False
31-
4 != 5 # True
32-
```
29+
`4 != 4 # False`
30+
31+
`4 != 5 # True`
3332

3433
### Greater than `>`
3534
`10 > 10 # False`

course_contents/1_intro/notes/06. Identity Operators.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
- Return True if the operands have the same identity
33

44
Example:
5-
6-
```python
5+
```
76
users = ['James', 'Charlie', 'Ana']
87
print(id(users)) # 2425142160952
98
@@ -22,8 +21,7 @@ print(users_copy is users) # False
2221
- Returns True if the operands don't have the same identity
2322

2423
Example:
25-
26-
```python
24+
```
2725
users = ['James', 'Charlie', 'Ana']
2826
print(id(users)) # 2425142160952
2927

course_contents/1_intro/notes/07. Membership Operators.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Example:
55
```python
66
users = ['James', 'Charlie', 'Ana']
7-
print("Johnny" in users) # False
7+
print("Johnny" in users)
88
```
99

1010
## NOT IN
@@ -13,5 +13,5 @@ print("Johnny" in users) # False
1313
Example:
1414
```python
1515
users = ['James', 'Charlie', 'Ana']
16-
print("Johnny" not in users) # True
16+
print("Johnny" in users)
1717
```

0 commit comments

Comments
 (0)
0