Skip to content

Commit 591c734

Browse files
author
abregman
committed
Add a couple of exercises
Added also a small description as to what this project is all about.
1 parent e2ad153 commit 591c734

File tree

9 files changed

+64
-0
lines changed

9 files changed

+64
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<p align="center"><img src="images/python_exercises.png"/></p>
22

3+
:information_source: &nbsp;This repo contains questions and exercises to learn and practice Python
4+
5+
:bar_chart: &nbsp;There are currently **49** exercises and questions
6+
37
# Python Exercises
48

59
## Hello World
@@ -21,6 +25,7 @@
2125
| Choose a Data Type - level 2 | [Exercise](exercises/data_types/choose_datatype_level_2.md) | [Solution](solutions/data_types/choose_datatype_level_2.md) | |
2226
| Mutability | [Exercise](exercises/data_types/mutability.md) | [Solution](solutions/data_types/mutability.md) | |
2327
| Strongly Typed | [Exercise](exercises/data_types/strongly_typed.md) | [Solution](solutions/data_types/strongly_typed.md) | |
28+
| Object Creation | [Exercise](exercises/data_types/object_creation.md) | [Solution](solutions/data_types/object_creation.md) | |
2429

2530
## Variables
2631

@@ -29,6 +34,7 @@
2934
| Valid Names | [Exercise](exercises/variables/valid_names.md) | [Solution](solutions/variables/valid_names.md) | |
3035
| Locations or Names | [Exercise](exercises/variables/locations_or_names.md) | [Solution](solutions/variables/locations_or_names.md) | |
3136
| Types | [Exercise](exercises/variables/types.md) | [Solution](solutions/variables/types.md) | |
37+
| Multiple Value Assignment | [Exercise](exercises/variables/multiple_value_assigment.md) | [Solution](solutions/variables/multiple_value_assigment.md) | |
3238

3339
## Booleans
3440

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Object Creation
2+
3+
1. Describe in detail what happens when the following code is executed: `var = 3`
4+
5+
### Solution
6+
7+
Click [here](solutions/data_types/object_creation.md) to view the solution
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
## Python Characteristics
22

33
1. What are some characteristics of the Python programming language?
4+
5+
Click here for the [solution](solutions/hello_world/python_characteristics.md)

exercises/hello_world/what_is_the_result_lvl_1.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@
66
* `1 == 1`
77
* `4 < 1`
88
* `'two' > 1`
9+
10+
Click here for the [solution](solutions/hello_world/what_is_the_result_lvl_1.md)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Multiple Value Assignment
2+
3+
1. How can you write the following code differently but have the same result?
4+
5+
```
6+
a=1
7+
b=1
8+
c=1
9+
```
10+
11+
### Solution
12+
13+
Click [here](solutions/variables/multiple_value_assigment.md) to view the solution

exercises/variables/types.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Types
2+
3+
1. How to check the type of a variable in Python?
4+
2. How to check if a variable points to an object of an integer type?
5+
3. How to check type of a literal?

scripts/count_questions.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
echo $(( $(grep -E "\[Exercise\]|</summary>" -c README.md )))
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Object Creation
2+
3+
1. Describe in detail what happens when the following code is executed: `var = 3`
4+
5+
### Solution
6+
7+
* An object of type integer is created with the value of 3.<br>
8+
* The variable points `var` points to the created object<br>
9+
* Reference count is incremented by 1
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Multiple Value Assignment
2+
3+
1. How can you write the following code differently but have the same result?
4+
5+
```
6+
a=1
7+
b=1
8+
c=1
9+
```
10+
11+
### Solution
12+
13+
1.
14+
15+
```
16+
a=b=c=1
17+
```

0 commit comments

Comments
 (0)