Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 01_Day_Introduction/helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
print(type('Asabeneh')) # String
print(type([1, 2, 3])) # List
print(type({'name': 'Asabeneh'})) # Dictionary
print(type({9.8, 3.14, 2.7})) # Tuple
print(type({9.8, 3.14, 2.7})) # Set
print(type((9.8, 3.14, 2.7))) # Tuple
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,8 @@ print(num_str) # '10'
num_str = '10.6'
num_float = float(num_str) # Convert the string to a float first
num_int = int(num_float) # Then convert the float to an integer
print('num_int', int(num_str)) # 10
print('num_float', float(num_str)) # 10.6
num_int = int(num_float)
print('num_int', int(num_int)) # 10
print('num_int', num_int) # 10
print('num_float', num_float) # 10.6

# str to list
first_name = 'Asabeneh'
Expand Down
14 changes: 7 additions & 7 deletions 08_Day_Dictionaries/08_dictionaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

## Dictionaries

A dictionary is a collection of unordered, modifiable(mutable) paired (key: value) data type.
A dictionary is a collection of insertion-ordered (since Python 3.7+), modifiable(mutable) paired (key: value) data type.

### Creating a Dictionary

Expand All @@ -60,7 +60,7 @@ person = {
'last_name':'Yetayeh',
'age':250,
'country':'Finland',
'is_marred':True,
'is_married':True,
'skills':['JavaScript', 'React', 'Node', 'MongoDB', 'Python'],
'address':{
'street':'Space street',
Expand Down Expand Up @@ -119,7 +119,7 @@ person = {
'last_name':'Yetayeh',
'age':250,
'country':'Finland',
'is_marred':True,
'is_married':True,
'skills':['JavaScript', 'React', 'Node', 'MongoDB', 'Python'],
'address':{
'street':'Space street',
Expand All @@ -141,7 +141,7 @@ person = {
'last_name':'Yetayeh',
'age':250,
'country':'Finland',
'is_marred':True,
'is_married':True,
'skills':['JavaScript', 'React', 'Node', 'MongoDB', 'Python'],
'address':{
'street':'Space street',
Expand Down Expand Up @@ -172,7 +172,7 @@ person = {
'last_name':'Yetayeh',
'age':250,
'country':'Finland',
'is_marred':True,
'is_married':True,
'skills':['JavaScript', 'React', 'Node', 'MongoDB', 'Python'],
'address':{
'street':'Space street',
Expand Down Expand Up @@ -202,7 +202,7 @@ person = {
'last_name':'Yetayeh',
'age':250,
'country':'Finland',
'is_marred':True,
'is_married':True,
'skills':['JavaScript', 'React', 'Node', 'MongoDB', 'Python'],
'address':{
'street':'Space street',
Expand Down Expand Up @@ -247,7 +247,7 @@ person = {
'last_name':'Yetayeh',
'age':250,
'country':'Finland',
'is_marred':True,
'is_married':True,
'skills':['JavaScript', 'React', 'Node', 'MongoDB', 'Python'],
'address':{
'street':'Space street',
Expand Down
2 changes: 1 addition & 1 deletion 14_Day_Higher_order_functions/14_higher_order_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
1. Use filter to filter out countries having exactly six characters.
1. Use filter to filter out countries containing six letters and more in the country list.
1. Use filter to filter out countries starting with an 'E'
1. Chain two or more list iterators (eg. arr.map(callback).filter(callback).reduce(callback))
1. Chain two or more list iterators (eg. use map(), filter(), and reduce() together on a list.)
1. Declare a function called get_string_lists which takes a list as a parameter and then returns a list containing only string items.
1. Use reduce to sum all the numbers in the numbers list.
1. Use reduce to concatenate all the countries and to produce this sentence: Estonia, Finland, Sweden, Denmark, Norway, and Iceland are north European countries
Expand Down
2 changes: 1 addition & 1 deletion 18_Day_Regular_expressions/18_regular_expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ To find a pattern we use different set of *re* character sets that allows to sea

```py
# syntax
re.match(substring, string, re.I)
re.search(substring, string, re.I)
# substring is a string or a pattern, string is the text we look for a pattern , re.I is case ignore
```

Expand Down
2 changes: 1 addition & 1 deletion 22_Day_Web_scraping/22_web_scraping.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ For reference check the [beautifulsoup documentation](https://www.crummy.com/sof

## 💻 Exercises: Day 22

1. Scrape the following website and store the data as json file(url = 'http://www.bu.edu/president/boston-university-facts-stats/').
1. Scrape the following website and store the data as json file(url = 'https://www.bu.edu/president/boston-university-facts-stats/').
1. Extract the table in this url (https://archive.ics.uci.edu/ml/datasets.php) and change it to a json file
2. Scrape the presidents table and store the data as json(https://en.wikipedia.org/wiki/List_of_presidents_of_the_United_States). The table is not very structured and the scrapping may take very long time.

Expand Down