Skip to content

Commit ea514a9

Browse files
committed
Done till 13.4, tomorrow we will start with 14
1 parent 655d3f7 commit ea514a9

File tree

25 files changed

+154
-7
lines changed

25 files changed

+154
-7
lines changed

.learn/resets/12-Map_a_list/app.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
celsius_values = [-2, 34, 56, -10]
2+
3+
def celsius_to_fahrenheit(celsius):
4+
# The magic happens here
5+
6+
7+
result = list(map(celsius_to_fahrenheit, celsius_values))
8+
9+
print(result)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
my_numbers = [23,234,345,4356234,243,43,56,2]
2+
3+
# Your code here
4+
5+
print(new_list)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
names = ['Alice', 'Bob', 'Marry', 'Joe', 'Hilary', 'Stevia', 'Dylan']
2+
3+
def prepender(name):
4+
return "My name is: " + name
5+
6+
# Your code here
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
mixed_list = ['1','5','45','34','343','34',6556,323]
2+
3+
def type_list(items):
4+
# Your code here
5+
return
6+
7+
new_list = list(map(type_list, mixed_list))
8+
9+
print(new_list)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import datetime
2+
3+
people = [
4+
{ "name": 'Joe', "birth_date": datetime.datetime(1986,10,24) },
5+
{ "name": 'Bob', "birth_date": datetime.datetime(1975,5,24) },
6+
{ "name": 'Erika', "birth_date": datetime.datetime(1989,6,12) },
7+
{ "name": 'Dylan', "birth_date": datetime.datetime(1999,12,14) },
8+
{ "name": 'Steve', "birth_date": datetime.datetime(2003,4,24) }
9+
]
10+
11+
def calculate_age(date_of_birth):
12+
today = datetime.date.today()
13+
age = today.year - date_of_birth.year - ((today.month, today.day) < (date_of_birth.month, date_of_birth.day))
14+
return age
15+
16+
def format_greeting(person):
17+
# Your code here
18+
return person["name"]
19+
20+
21+
name_list = list(map(format_greeting, people))
22+
23+
print(name_list)

.learn/resets/12.5-Yes_and_no/app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
the_bools = [0,1,0,0,1,1,1,0,0,1,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1]
2+
3+
# Your code here
4+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
incoming_ajax_data = [
2+
{ "name": 'Mario', "last_name": 'Montes' },
3+
{ "name": 'Joe', "last_name": 'Biden' },
4+
{ "name": 'Bill', "last_name": 'Clon' },
5+
{ "name": 'Hilary', "last_name": 'Mccafee' },
6+
{ "name": 'Bobby', "last_name": 'Mc birth' }
7+
]
8+
9+
# Your code here
10+

.learn/resets/13-Filter_list/app.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
all_numbers = [23,12,35,5,3,2,3,54,3,21,534,23,42,1]
2+
3+
4+
def filter_function(item):
5+
# Update here
6+
return item % 2 == 1
7+
8+
greater_than_ten = list(filter(filter_function, all_numbers))
9+
10+
print(greater_than_ten)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
all_names = ["Romario", "Boby", "Roosevelt", "Emiliy", "Michael", "Greta", "Patricia", "Danzalee"]
2+
3+
# Your code here
4+
5+
print(resulting_names)
6+
7+
8+
9+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
tasks = [
2+
{ "label": 'Eat my lunch', "done": True },
3+
{ "label": 'Make the bed', "done": False },
4+
{ "label": 'Have some fun', "done": False },
5+
{ "label": 'Finish the replits', "done": False },
6+
{ "label": 'Replit the finishes', "done": True },
7+
{ "label": 'Ask for a raise', "done": False },
8+
{ "label": 'Read a book', "done": True },
9+
{ "label": 'Make a trip', "done": False }
10+
]
11+
12+
13+
# Your code here
14+

0 commit comments

Comments
 (0)