File tree 7 files changed +85
-1
lines changed
7 files changed +85
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
:information_source :   ; This repo contains questions and exercises to learn and practice Python
4
4
5
- :bar_chart :   ; There are currently ** 49 ** exercises and questions
5
+ :bar_chart :   ; There are currently ** 53 ** exercises and questions
6
6
7
7
# Python Exercises
8
8
35
35
| Locations or Names | [ Exercise] ( exercises/variables/locations_or_names.md ) | [ Solution] ( solutions/variables/locations_or_names.md ) | |
36
36
| Types | [ Exercise] ( exercises/variables/types.md ) | [ Solution] ( solutions/variables/types.md ) | |
37
37
| Multiple Value Assignment | [ Exercise] ( exercises/variables/multiple_value_assigment.md ) | [ Solution] ( solutions/variables/multiple_value_assigment.md ) | |
38
+ | Copying Variables | [ Exercise] ( exercises/variables/copying_variables.md ) | [ Solution] ( solutions/variables/copying_variables.md ) | |
39
+ | Mutable Objects | [ Exercise] ( exercises/variables/mutable_objects.md ) | [ Solution] ( solutions/variables/mutable_objects.md ) | |
38
40
39
41
## Booleans
40
42
58
60
59
61
| Name| Objective & Instructions| Solution| Comments|
60
62
| --------| --------| ------| ----|
63
+ | What is the result? | [ Exercise] ( exercises/numbers/what_is_the_result.md ) | [ Solution] ( solutions/numbers/what_is_the_result.md ) | |
61
64
| Palindrome | [ Exercise] ( exercises/numbers/palindrome.md ) | [ Solution] ( solutions/numbers/palindrome.md ) | |
62
65
63
66
## Lists
Original file line number Diff line number Diff line change
1
+ ## What is the result?
2
+
3
+ What is the value of each of the following variables?
4
+
5
+ 1 . ` x = 5,000 `
6
+ 2 . ` x = 5_000 `
7
+ 3 . ` x = 5_0_0 `
8
+
9
+ ### Solution
10
+
11
+ Click [ here] ( solutions/numbers/what_is_the_result.md ) for the solution
Original file line number Diff line number Diff line change
1
+ ## Copying Variables
2
+
3
+ 1 . True or False?
4
+
5
+ Running ` var = 3 ` creates an object. Running ` another_var = var ` creates another object with the value of ` var `
6
+
7
+ ### Solution
8
+
9
+ Click [ here] ( solutions/variables/copying_variables.md ) to view the solution.
Original file line number Diff line number Diff line change
1
+ ## Mutable Objects
2
+
3
+ 1 . What would be the output of the following program? explain
4
+
5
+ ```
6
+ x = [1, 2 ,3]
7
+ y = x
8
+ print(x)
9
+ print(y)
10
+ x[0] = 0
11
+ print(x)
12
+ print(y)
13
+ ```
14
+
15
+ ### Solution
16
+
17
+ Click [ here] ( solutions/variables/mutable_objects.md ) to view the solution
Original file line number Diff line number Diff line change
1
+ ## What is the result?
2
+
3
+ What is the value of each of the following variables?
4
+
5
+ 1 . ` x = 5,000 `
6
+ 2 . ` x = 5_000 `
7
+ 3 . ` x = 5_0_0 `
8
+
9
+ ### Solution
10
+
11
+ 1 . ` (5,0) `
12
+ 2 . ` 5000 `
13
+ 3 . ` 500 `
Original file line number Diff line number Diff line change
1
+ ## Copying Variables
2
+
3
+ 1 . True or False?
4
+
5
+ Running ` var = 3 ` creates an object. Running ` another_var = var ` creates another object with the value of ` var `
6
+
7
+ ### Solution
8
+
9
+ False. ` another_var = var ` makes ` another_var ` to point to the same object ` var ` points to. It doesn't creates another object.
Original file line number Diff line number Diff line change
1
+ ## Mutable Objects
2
+
3
+ 1 . What would be the output of the following program? explain
4
+
5
+ ```
6
+ x = [1, 2 ,3]
7
+ y = x
8
+ print(x)
9
+ print(y)
10
+ x[0] = 0
11
+ print(x)
12
+ print(y)
13
+ ```
14
+
15
+ ### Solution
16
+
17
+ ```
18
+ [1, 2, 3]
19
+ [1, 2, 3]
20
+ [0, 2, 3]
21
+ [0, 2, 3]
22
+ ```
You can’t perform that action at this time.
0 commit comments