diff --git a/01_Day_Introduction/helloworld.py b/01_Day_Introduction/helloworld.py index d8007868f..f8b7d8f4e 100644 --- a/01_Day_Introduction/helloworld.py +++ b/01_Day_Introduction/helloworld.py @@ -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 \ No newline at end of file diff --git a/02_Day_Variables_builtin_functions/02_variables_builtin_functions.md b/02_Day_Variables_builtin_functions/02_variables_builtin_functions.md index 722edb3ad..0eebfcec5 100644 --- a/02_Day_Variables_builtin_functions/02_variables_builtin_functions.md +++ b/02_Day_Variables_builtin_functions/02_variables_builtin_functions.md @@ -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' diff --git a/08_Day_Dictionaries/08_dictionaries.md b/08_Day_Dictionaries/08_dictionaries.md index 07bd049e3..25694154a 100644 --- a/08_Day_Dictionaries/08_dictionaries.md +++ b/08_Day_Dictionaries/08_dictionaries.md @@ -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 @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', diff --git a/14_Day_Higher_order_functions/14_higher_order_functions.md b/14_Day_Higher_order_functions/14_higher_order_functions.md index 6787584c1..2a85a2ed4 100644 --- a/14_Day_Higher_order_functions/14_higher_order_functions.md +++ b/14_Day_Higher_order_functions/14_higher_order_functions.md @@ -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 diff --git a/18_Day_Regular_expressions/18_regular_expressions.md b/18_Day_Regular_expressions/18_regular_expressions.md index b8b934e7e..775c0e936 100644 --- a/18_Day_Regular_expressions/18_regular_expressions.md +++ b/18_Day_Regular_expressions/18_regular_expressions.md @@ -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 ``` diff --git a/22_Day_Web_scraping/22_web_scraping.md b/22_Day_Web_scraping/22_web_scraping.md index 5c6a69bc9..e20e917d2 100644 --- a/22_Day_Web_scraping/22_web_scraping.md +++ b/22_Day_Web_scraping/22_web_scraping.md @@ -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.