From c634f66ee682453a86864b67d1214a2310b6f09a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C3=ADas=20JR?= <167987056+eliasjr89@users.noreply.github.com> Date: Wed, 11 Sep 2024 10:55:03 +0000 Subject: [PATCH] ejr --- .learn/resets/01-hello-world/app.py | 1 + .learn/resets/01.1-Access-and-Retrieve/app.py | 7 ++++++ .learn/resets/01.2-Retrieve-items/app.py | 5 ++++ .learn/resets/01.3-Print-the-last-one/app.py | 16 +++++++++++++ .learn/resets/01.4-loop-seventeen/app.py | 1 + .learn/resets/01.5-Add-item-to-list/app.py | 5 ++++ .learn/resets/02-Loop-list/app.py | 4 ++++ .learn/resets/02.1-Loop-from-the-top/app.py | 6 +++++ .learn/resets/02.2-Loop-adding-two/app.py | 7 ++++++ .../02.3-loop-from-the-half-to-the-end/app.py | 9 ++++++++ .learn/resets/02.4-One_last_looping/app.py | 3 +++ .learn/resets/02.5-Finding_wally/app.py | 3 +++ .learn/resets/03-flip_list/app.py | 3 +++ .learn/resets/04-mixed_list/app.py | 3 +++ .learn/resets/04.1-count_on/app.py | 3 +++ .learn/resets/05-Sum_all_items/app.py | 10 ++++++++ .learn/resets/05.1-sum_odd_items/app.py | 3 +++ .learn/resets/06-Print_by_condition/app.py | 6 +++++ .../resets/06.1-Everything_is_awesome/app.py | 11 +++++++++ .learn/resets/07-Do_while/app.py | 1 + .learn/resets/08-Delete_element/app.py | 11 +++++++++ .learn/resets/08.1-Merge_list/app.py | 9 ++++++++ .learn/resets/08.2-Divide_and_conquer/app.py | 7 ++++++ .learn/resets/09-Max_integer_from_list/app.py | 3 +++ .learn/resets/09.1-For_loop_min_value/app.py | 3 +++ .learn/resets/10-Find_avg/app.py | 3 +++ .../10.1-And_One_and_a_Two_and_a_Three/app.py | 8 +++++++ .learn/resets/11-Nested_list/app.py | 3 +++ .learn/resets/12-Map_a_list/app.py | 9 ++++++++ .learn/resets/12.1-more_mapping/app.py | 5 ++++ .../12.2-Map_function_inside_variable/app.py | 6 +++++ .learn/resets/12.3-Map_data_types/app.py | 9 ++++++++ .learn/resets/12.4-Map_list_of_objects/app.py | 23 +++++++++++++++++++ .learn/resets/12.5-Yes_and_no/app.py | 4 ++++ .learn/resets/12.6-Transformers/app.py | 10 ++++++++ .learn/resets/13-Filter_list/app.py | 10 ++++++++ .learn/resets/13.1-Filter_and_list/app.py | 9 ++++++++ .learn/resets/13.2-filter_done_tasks/app.py | 14 +++++++++++ .learn/resets/13.3-Filter_list_strings/app.py | 3 +++ .../app.py | 12 ++++++++++ .learn/resets/14-Loop-dictionary/app.py | 7 ++++++ .learn/resets/14.1-letter_counter/app.py | 8 +++++++ .learn/resets/15.1-Matrix_Builder/app.py | 1 + .learn/resets/15.2-Parking_lot_check/app.py | 7 ++++++ .learn/resets/16-Techno_beat/app.py | 8 +++++++ exercises/01-hello-world/app.py | 1 + exercises/01.1-Access-and-Retrieve/app.py | 5 ++-- exercises/01.2-Retrieve-items/app.py | 3 ++- exercises/01.3-Print-the-last-one/app.py | 2 ++ exercises/01.4-loop-seventeen/app.py | 2 ++ exercises/01.5-Add-item-to-list/app.py | 7 ++++++ exercises/02-Loop-list/app.py | 3 +++ exercises/02.1-Loop-from-the-top/app.py | 2 +- exercises/02.2-Loop-adding-two/app.py | 2 +- .../02.3-loop-from-the-half-to-the-end/app.py | 6 ++--- exercises/02.4-One_last_looping/app.py | 6 +++++ exercises/02.5-Finding_wally/app.py | 3 +++ exercises/03-flip_list/app.py | 6 +++++ exercises/04-mixed_list/app.py | 3 +++ exercises/04.1-count_on/app.py | 7 ++++++ exercises/05-Sum_all_items/app.py | 5 ++-- exercises/05.1-sum_odd_items/app.py | 8 +++++++ exercises/06-Print_by_condition/app.py | 3 ++- exercises/06.1-Everything_is_awesome/app.py | 5 +++- exercises/07-Do_while/app.py | 11 +++++++++ exercises/08-Delete_element/app.py | 8 +++++-- exercises/08.1-Merge_list/app.py | 8 ++++++- exercises/08.2-Divide_and_conquer/app.py | 14 +++++++++++ exercises/09-Max_integer_from_list/app.py | 10 ++++++++ .../09-Max_integer_from_list/solution.hide.py | 3 ++- exercises/09.1-For_loop_min_value/app.py | 10 ++++++++ exercises/10-Find_avg/app.py | 9 ++++++++ exercises/11-Nested_list/app.py | 3 +++ exercises/12-Map_a_list/app.py | 2 +- exercises/12.1-more_mapping/app.py | 6 +++++ .../12.2-Map_function_inside_variable/app.py | 4 ++++ exercises/12.3-Map_data_types/app.py | 2 +- exercises/12.4-Map_list_of_objects/app.py | 4 +++- exercises/12.5-Yes_and_no/app.py | 2 ++ exercises/12.6-Transformers/app.py | 4 ++++ exercises/13-Filter_list/app.py | 2 +- exercises/13.1-Filter_and_list/app.py | 4 ++++ exercises/13.2-filter_done_tasks/app.py | 7 +++++- exercises/13.3-Filter_list_strings/app.py | 4 ++++ .../app.py | 9 ++++++++ exercises/14-Loop-dictionary/app.py | 4 +++- exercises/14.1-letter_counter/app.py | 15 +++++++++++- exercises/15.1-Matrix_Builder/app.py | 14 +++++++++++ exercises/15.2-Parking_lot_check/app.py | 13 +++++++++++ exercises/16-Techno_beat/app.py | 18 ++++++++++++++- 90 files changed, 544 insertions(+), 24 deletions(-) create mode 100644 .learn/resets/01-hello-world/app.py create mode 100644 .learn/resets/01.1-Access-and-Retrieve/app.py create mode 100644 .learn/resets/01.2-Retrieve-items/app.py create mode 100644 .learn/resets/01.3-Print-the-last-one/app.py create mode 100644 .learn/resets/01.4-loop-seventeen/app.py create mode 100644 .learn/resets/01.5-Add-item-to-list/app.py create mode 100644 .learn/resets/02-Loop-list/app.py create mode 100644 .learn/resets/02.1-Loop-from-the-top/app.py create mode 100644 .learn/resets/02.2-Loop-adding-two/app.py create mode 100644 .learn/resets/02.3-loop-from-the-half-to-the-end/app.py create mode 100644 .learn/resets/02.4-One_last_looping/app.py create mode 100644 .learn/resets/02.5-Finding_wally/app.py create mode 100644 .learn/resets/03-flip_list/app.py create mode 100644 .learn/resets/04-mixed_list/app.py create mode 100644 .learn/resets/04.1-count_on/app.py create mode 100644 .learn/resets/05-Sum_all_items/app.py create mode 100644 .learn/resets/05.1-sum_odd_items/app.py create mode 100644 .learn/resets/06-Print_by_condition/app.py create mode 100644 .learn/resets/06.1-Everything_is_awesome/app.py create mode 100644 .learn/resets/07-Do_while/app.py create mode 100644 .learn/resets/08-Delete_element/app.py create mode 100644 .learn/resets/08.1-Merge_list/app.py create mode 100644 .learn/resets/08.2-Divide_and_conquer/app.py create mode 100644 .learn/resets/09-Max_integer_from_list/app.py create mode 100644 .learn/resets/09.1-For_loop_min_value/app.py create mode 100644 .learn/resets/10-Find_avg/app.py create mode 100644 .learn/resets/10.1-And_One_and_a_Two_and_a_Three/app.py create mode 100644 .learn/resets/11-Nested_list/app.py create mode 100644 .learn/resets/12-Map_a_list/app.py create mode 100644 .learn/resets/12.1-more_mapping/app.py create mode 100644 .learn/resets/12.2-Map_function_inside_variable/app.py create mode 100644 .learn/resets/12.3-Map_data_types/app.py create mode 100644 .learn/resets/12.4-Map_list_of_objects/app.py create mode 100644 .learn/resets/12.5-Yes_and_no/app.py create mode 100644 .learn/resets/12.6-Transformers/app.py create mode 100644 .learn/resets/13-Filter_list/app.py create mode 100644 .learn/resets/13.1-Filter_and_list/app.py create mode 100644 .learn/resets/13.2-filter_done_tasks/app.py create mode 100644 .learn/resets/13.3-Filter_list_strings/app.py create mode 100644 .learn/resets/13.4-Making_HTML_with_filter_and_maP/app.py create mode 100644 .learn/resets/14-Loop-dictionary/app.py create mode 100644 .learn/resets/14.1-letter_counter/app.py create mode 100644 .learn/resets/15.1-Matrix_Builder/app.py create mode 100644 .learn/resets/15.2-Parking_lot_check/app.py create mode 100644 .learn/resets/16-Techno_beat/app.py diff --git a/.learn/resets/01-hello-world/app.py b/.learn/resets/01-hello-world/app.py new file mode 100644 index 00000000..fce62c1d --- /dev/null +++ b/.learn/resets/01-hello-world/app.py @@ -0,0 +1 @@ +# Your code here diff --git a/.learn/resets/01.1-Access-and-Retrieve/app.py b/.learn/resets/01.1-Access-and-Retrieve/app.py new file mode 100644 index 00000000..250261b7 --- /dev/null +++ b/.learn/resets/01.1-Access-and-Retrieve/app.py @@ -0,0 +1,7 @@ +my_list = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] + +# 1. Print the 3rd item here + +# 2. Change the value of 'thursday' to None + +# 3. Print that position now here diff --git a/.learn/resets/01.2-Retrieve-items/app.py b/.learn/resets/01.2-Retrieve-items/app.py new file mode 100644 index 00000000..9208b3cd --- /dev/null +++ b/.learn/resets/01.2-Retrieve-items/app.py @@ -0,0 +1,5 @@ +my_list = [4,5,734,43,45,100,4,56,23,67,23,58,45,3,100,4,56,23] + +# Print in the console the 1st element on the list + +# Print in the console the 4th element on the list diff --git a/.learn/resets/01.3-Print-the-last-one/app.py b/.learn/resets/01.3-Print-the-last-one/app.py new file mode 100644 index 00000000..68fa5b25 --- /dev/null +++ b/.learn/resets/01.3-Print-the-last-one/app.py @@ -0,0 +1,16 @@ +# import the random package here "import random" +import random + +def generate_random_list(): + aux_list = [] + randonlength = random.randint(1, 100) + + for i in range(randonlength): + aux_list.append(randonlength) + i += i + return aux_list + +my_stupid_list = generate_random_list() + +# Write your code below this comment, good luck! + diff --git a/.learn/resets/01.4-loop-seventeen/app.py b/.learn/resets/01.4-loop-seventeen/app.py new file mode 100644 index 00000000..0bdc85b5 --- /dev/null +++ b/.learn/resets/01.4-loop-seventeen/app.py @@ -0,0 +1 @@ +# Your code here, have fun: diff --git a/.learn/resets/01.5-Add-item-to-list/app.py b/.learn/resets/01.5-Add-item-to-list/app.py new file mode 100644 index 00000000..c74ded5f --- /dev/null +++ b/.learn/resets/01.5-Add-item-to-list/app.py @@ -0,0 +1,5 @@ +# Remember to import random function here + +my_list = [4, 5, 734, 43, 45] + +# The magic goes below diff --git a/.learn/resets/02-Loop-list/app.py b/.learn/resets/02-Loop-list/app.py new file mode 100644 index 00000000..13b3228b --- /dev/null +++ b/.learn/resets/02-Loop-list/app.py @@ -0,0 +1,4 @@ +my_list = [232,32,1,4,55,4,3,32,3,24,5,5,5,34,2,35,5365743,52,34,3,55] + +# Your code here +print(my_list[0]) diff --git a/.learn/resets/02.1-Loop-from-the-top/app.py b/.learn/resets/02.1-Loop-from-the-top/app.py new file mode 100644 index 00000000..1442ea68 --- /dev/null +++ b/.learn/resets/02.1-Loop-from-the-top/app.py @@ -0,0 +1,6 @@ +my_sample_list = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12] + +# Modify the loop below to print from end to start + +for i in range(0, len(my_sample_list)): + print(my_sample_list[i]) diff --git a/.learn/resets/02.2-Loop-adding-two/app.py b/.learn/resets/02.2-Loop-adding-two/app.py new file mode 100644 index 00000000..2a2a5f60 --- /dev/null +++ b/.learn/resets/02.2-Loop-adding-two/app.py @@ -0,0 +1,7 @@ +my_sample_list = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12] + +# Your code below, don't change anything above + +for i in range(0, len(my_sample_list), 1): + print(my_sample_list[i]) + diff --git a/.learn/resets/02.3-loop-from-the-half-to-the-end/app.py b/.learn/resets/02.3-loop-from-the-half-to-the-end/app.py new file mode 100644 index 00000000..a2cf3175 --- /dev/null +++ b/.learn/resets/02.3-loop-from-the-half-to-the-end/app.py @@ -0,0 +1,9 @@ +my_list = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12] + +# Your code here +inicial_value = 0 +stop_value = 0 +increase_value = 0 + +for i in range(inicial_value, stop_value, increase_value): + print(my_list[i]) diff --git a/.learn/resets/02.4-One_last_looping/app.py b/.learn/resets/02.4-One_last_looping/app.py new file mode 100644 index 00000000..0607676f --- /dev/null +++ b/.learn/resets/02.4-One_last_looping/app.py @@ -0,0 +1,3 @@ +names = ['Esmeralda','Kiko','Ruth','Lebron','Pedro','Maria','Lou','Fernando','Cesco','Bart','Annie'] + +# Your code here diff --git a/.learn/resets/02.5-Finding_wally/app.py b/.learn/resets/02.5-Finding_wally/app.py new file mode 100644 index 00000000..44797d49 --- /dev/null +++ b/.learn/resets/02.5-Finding_wally/app.py @@ -0,0 +1,3 @@ +people = ['Lebron','Aaliyah','Diamond','Dominique','Aliyah','Jazmin','Darnell','Hatfield','Hawkins','Hayden','Hayes','Haynes','Hays','Head','Heath','Hebert','Henderson','Hendricks','Hendrix','Henry','Hensley','Henson','Herman','Hernandez','Herrera','Herring','Hess','Hester','Hewitt','Hickman','Hicks','Higgins','Hill','Hines','Hinton','Hobbs','Hodge','Hodges','Hoffman','Hogan','Holcomb','Holden','Holder','Holland','Holloway','Holman','Holmes','Holt','Hood','Hooper','Hoover','Hopkins','Hopper','Horn','Horne','Horton','House','Houston','Howard','Howe','Howell','Hubbard','Huber','Hudson','Huff','Wally','Hughes','Hull','Humphrey','Hunt','Hunter','Hurley','Hurst','Hutchinson','Hyde','Ingram','Irwin','Jackson','Jacobs','Jacobson','James','Jarvis','Jefferson','Jenkins','Jennings','Jensen','Jimenez','Johns','Johnson','Johnston','Jones','Jordan','Joseph','Joyce','Joyner','Juarez','Justice','Kane','Kaufman','Keith','Keller','Kelley','Kelly','Kemp','Kennedy','Kent','Kerr','Key','Kidd','Kim','King','Kinney','Kirby','Kirk','Kirkland','Klein','Kline','Knapp','Knight','Knowles','Knox','Koch','Kramer','Lamb','Lambert','Lancaster','Landry','Lane','Lang','Langley','Lara','Larsen','Larson','Lawrence','Lawson','Le','Leach','Leblanc','Lee','Leon','Leonard','Lester','Levine','Levy','Lewis','Lindsay','Lindsey','Little','Livingston','Lloyd','Logan','Long','Lopez','Lott','Love','Lowe','Lowery','Lucas','Luna','Lynch','Lynn','Lyons','Macdonald','Macias','Mack','Madden','Maddox','Maldonado','Malone','Mann','Manning','Marks','Marquez','Marsh','Marshall','Martin','Martinez','Mason','Massey','Mathews','Mathis','Matthews','Maxwell','May','Mayer','Maynard','Mayo','Mays','Mcbride','Mccall','Mccarthy','Mccarty','Mcclain','Mcclure','Mcconnell','Mccormick','Mccoy','Mccray','Wally','Mcdaniel','Mcdonald','Mcdowell','Mcfadden','Mcfarland','Mcgee','Mcgowan','Mcguire','Mcintosh','Mcintyre','Mckay','Mckee','Mckenzie','Mckinney','Mcknight','Mclaughlin','Mclean','Mcleod','Mcmahon','Mcmillan','Mcneil','Mcpherson','Meadows','Medina','Mejia','Melendez','Melton','Mendez','Mendoza','Mercado','Mercer','Merrill','Merritt','Meyer','Meyers','Michael','Middleton','Miles','Miller','Mills','Miranda','Mitchell','Molina','Monroe','Lucas','Jake','Scott','Amy','Molly','Hannah','Lucas'] + +# Your code here diff --git a/.learn/resets/03-flip_list/app.py b/.learn/resets/03-flip_list/app.py new file mode 100644 index 00000000..d2f3e18b --- /dev/null +++ b/.learn/resets/03-flip_list/app.py @@ -0,0 +1,3 @@ +sample_list = [45, 67, 87, 23, 5, 32, 60] + +# Your code below diff --git a/.learn/resets/04-mixed_list/app.py b/.learn/resets/04-mixed_list/app.py new file mode 100644 index 00000000..3aab4234 --- /dev/null +++ b/.learn/resets/04-mixed_list/app.py @@ -0,0 +1,3 @@ +mix = [42, True, "towel", [2,1], 'hello', 34.4, {"name": "juan"}] + +# Your code below diff --git a/.learn/resets/04.1-count_on/app.py b/.learn/resets/04.1-count_on/app.py new file mode 100644 index 00000000..c02ec494 --- /dev/null +++ b/.learn/resets/04.1-count_on/app.py @@ -0,0 +1,3 @@ +my_list = [42, True, "towel", [2,1], 'hello', 34.4, {"name": "juan"}] + +# Your code here diff --git a/.learn/resets/05-Sum_all_items/app.py b/.learn/resets/05-Sum_all_items/app.py new file mode 100644 index 00000000..26582cb2 --- /dev/null +++ b/.learn/resets/05-Sum_all_items/app.py @@ -0,0 +1,10 @@ +my_sample_list = [3423,5,4,47889,654,8,867543,23,48,5345,234,6,78,54,23,67,3,6,432,55,23,25,12] + +def sum_all_values(list): + total = 0 + # The magic happens here + + + return total + +print(sum_all_values(my_sample_list)) diff --git a/.learn/resets/05.1-sum_odd_items/app.py b/.learn/resets/05.1-sum_odd_items/app.py new file mode 100644 index 00000000..c6f86a84 --- /dev/null +++ b/.learn/resets/05.1-sum_odd_items/app.py @@ -0,0 +1,3 @@ +my_list = [4,5,734,43,45,100,4,56,23,67,23,58,45] + +# Your code here diff --git a/.learn/resets/06-Print_by_condition/app.py b/.learn/resets/06-Print_by_condition/app.py new file mode 100644 index 00000000..de6e8f61 --- /dev/null +++ b/.learn/resets/06-Print_by_condition/app.py @@ -0,0 +1,6 @@ +my_list = [3344,34334,454543,342534,4563456,3445,23455,234,262,2335,43323,4356,345,4545,452,345,434,36,345,4334,5454,345,4352,23,365,345,47,63,425,6578759,768,834,754,35,32,445,453456,56,7536867,3884526,4234,35353245,53244523,566785,7547,743,4324,523472634,26665,63432,54645,32,453625,7568,5669576,754,64356,542644,35,243,371,3251,351223,13231243,734,856,56,53,234342,56,545343] + + +for i in my_list: + # The magic happens here + diff --git a/.learn/resets/06.1-Everything_is_awesome/app.py b/.learn/resets/06.1-Everything_is_awesome/app.py new file mode 100644 index 00000000..4c3d0c26 --- /dev/null +++ b/.learn/resets/06.1-Everything_is_awesome/app.py @@ -0,0 +1,11 @@ +my_list = [1, 0, 0, 0, 1, 0, 0, 0, 1, 1] + +def my_function(numbers): + new_list = [] + for i in numbers: + # The magic happens here + + + return new_list + +print(my_function(my_list)) diff --git a/.learn/resets/07-Do_while/app.py b/.learn/resets/07-Do_while/app.py new file mode 100644 index 00000000..fce62c1d --- /dev/null +++ b/.learn/resets/07-Do_while/app.py @@ -0,0 +1 @@ +# Your code here diff --git a/.learn/resets/08-Delete_element/app.py b/.learn/resets/08-Delete_element/app.py new file mode 100644 index 00000000..36514c4d --- /dev/null +++ b/.learn/resets/08-Delete_element/app.py @@ -0,0 +1,11 @@ +people = ['juan','ana','michelle','daniella','stefany','lucy','barak'] + +def delete_person(person_name): + # Your code here + + + +# Don't delete anything below +print(delete_person("daniella")) +print(delete_person("juan")) +print(delete_person("emilio")) diff --git a/.learn/resets/08.1-Merge_list/app.py b/.learn/resets/08.1-Merge_list/app.py new file mode 100644 index 00000000..6146f098 --- /dev/null +++ b/.learn/resets/08.1-Merge_list/app.py @@ -0,0 +1,9 @@ +chunk_one = ['Lebron', 'Aaliyah', 'Diamond', 'Dominique', 'Aliyah', 'Jazmin', 'Darnell'] +chunk_two = ['Lucas', 'Jake', 'Scott', 'Amy', 'Molly', 'Hannah', 'Lucas'] + + +def merge_list(list1, list2): + # Your code here + + +print(merge_list(chunk_one, chunk_two)) diff --git a/.learn/resets/08.2-Divide_and_conquer/app.py b/.learn/resets/08.2-Divide_and_conquer/app.py new file mode 100644 index 00000000..106fd02b --- /dev/null +++ b/.learn/resets/08.2-Divide_and_conquer/app.py @@ -0,0 +1,7 @@ +list_of_numbers = [4, 80, 85, 59, 37, 25, 5, 64, 66, 81, 20, 64, 41, 22, 76, 76, 55, 96, 2, 68] + +# Your code here + + +print(sort_odd_even(list_of_numbers)) + diff --git a/.learn/resets/09-Max_integer_from_list/app.py b/.learn/resets/09-Max_integer_from_list/app.py new file mode 100644 index 00000000..c0a5a543 --- /dev/null +++ b/.learn/resets/09-Max_integer_from_list/app.py @@ -0,0 +1,3 @@ +my_list = [43,23,6,87,43,1,4,6,3,67,8,3445,3,7,5435,63,346,3,456,734,6,34] + +# Your code here diff --git a/.learn/resets/09.1-For_loop_min_value/app.py b/.learn/resets/09.1-For_loop_min_value/app.py new file mode 100644 index 00000000..594b1d3d --- /dev/null +++ b/.learn/resets/09.1-For_loop_min_value/app.py @@ -0,0 +1,3 @@ +my_list = [3344,34334,454543,342534,4563456,3445,23455,234,262,2335,43323,4356,345,4545,452,345,434,36,345,4334,5454,345,4352,23,365,345,47,63,425,6578759,768,834,754,35,32,445,453456,56,7536867,3884526,4234,35353245,53244523,566785,7547,743,4324,523472634,26665,63432,54645,32,453625,7568,5669576,754,64356,542644,35,243,371,3251,351223,13231243,734,856,56,53,234342,56,545343] + +# Your code here diff --git a/.learn/resets/10-Find_avg/app.py b/.learn/resets/10-Find_avg/app.py new file mode 100644 index 00000000..c881b318 --- /dev/null +++ b/.learn/resets/10-Find_avg/app.py @@ -0,0 +1,3 @@ +my_list = [2323,4344,2325,324413,21234,24531,2123,42234,544,456,345,42,5445,23,5656,423] + +# Your code here diff --git a/.learn/resets/10.1-And_One_and_a_Two_and_a_Three/app.py b/.learn/resets/10.1-And_One_and_a_Two_and_a_Three/app.py new file mode 100644 index 00000000..54e60221 --- /dev/null +++ b/.learn/resets/10.1-And_One_and_a_Two_and_a_Three/app.py @@ -0,0 +1,8 @@ +contact = { + "fullname": "Jane Doe", + "phone": "321-321-4321", + "email": "test@test.com" +} + +# Your code here + diff --git a/.learn/resets/11-Nested_list/app.py b/.learn/resets/11-Nested_list/app.py new file mode 100644 index 00000000..c08ecc4a --- /dev/null +++ b/.learn/resets/11-Nested_list/app.py @@ -0,0 +1,3 @@ +coordinates_list = [[33.747252, -112.633853], [-33.867886, -63.987], [41.303921, -81.901693], [-33.350534, -71.653268]] + +# Your code here diff --git a/.learn/resets/12-Map_a_list/app.py b/.learn/resets/12-Map_a_list/app.py new file mode 100644 index 00000000..bbaa6e5d --- /dev/null +++ b/.learn/resets/12-Map_a_list/app.py @@ -0,0 +1,9 @@ +celsius_values = [-2, 34, 56, -10] + +def celsius_to_fahrenheit(celsius): + # The magic happens here + + +result = list(map(celsius_to_fahrenheit, celsius_values)) + +print(result) diff --git a/.learn/resets/12.1-more_mapping/app.py b/.learn/resets/12.1-more_mapping/app.py new file mode 100644 index 00000000..c5d1ca14 --- /dev/null +++ b/.learn/resets/12.1-more_mapping/app.py @@ -0,0 +1,5 @@ +my_numbers = [23,234,345,4356234,243,43,56,2] + +# Your code here + +print(new_list) diff --git a/.learn/resets/12.2-Map_function_inside_variable/app.py b/.learn/resets/12.2-Map_function_inside_variable/app.py new file mode 100644 index 00000000..7146df37 --- /dev/null +++ b/.learn/resets/12.2-Map_function_inside_variable/app.py @@ -0,0 +1,6 @@ +names = ['Alice', 'Bob', 'Marry', 'Joe', 'Hilary', 'Stevia', 'Dylan'] + +def prepender(name): + return "My name is: " + name + +# Your code here diff --git a/.learn/resets/12.3-Map_data_types/app.py b/.learn/resets/12.3-Map_data_types/app.py new file mode 100644 index 00000000..c1225967 --- /dev/null +++ b/.learn/resets/12.3-Map_data_types/app.py @@ -0,0 +1,9 @@ +mixed_list = ['1','5','45','34','343','34',6556,323] + +def type_list(items): + # Your code here + return + +new_list = list(map(type_list, mixed_list)) + +print(new_list) diff --git a/.learn/resets/12.4-Map_list_of_objects/app.py b/.learn/resets/12.4-Map_list_of_objects/app.py new file mode 100644 index 00000000..de3e0d1f --- /dev/null +++ b/.learn/resets/12.4-Map_list_of_objects/app.py @@ -0,0 +1,23 @@ +import datetime + +people = [ + { "name": 'Joe', "birth_date": datetime.datetime(1986,10,24) }, + { "name": 'Bob', "birth_date": datetime.datetime(1975,5,24) }, + { "name": 'Erika', "birth_date": datetime.datetime(1989,6,12) }, + { "name": 'Dylan', "birth_date": datetime.datetime(1999,12,14) }, + { "name": 'Steve', "birth_date": datetime.datetime(2003,4,24) } +] + +def calculate_age(date_of_birth): + today = datetime.date.today() + age = today.year - date_of_birth.year - ((today.month, today.day) < (date_of_birth.month, date_of_birth.day)) + return age + +def format_greeting(person): + # Your code here + return person["name"] + + +name_list = list(map(format_greeting, people)) + +print(name_list) diff --git a/.learn/resets/12.5-Yes_and_no/app.py b/.learn/resets/12.5-Yes_and_no/app.py new file mode 100644 index 00000000..bdbe9f38 --- /dev/null +++ b/.learn/resets/12.5-Yes_and_no/app.py @@ -0,0 +1,4 @@ +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] + +# Your code here + diff --git a/.learn/resets/12.6-Transformers/app.py b/.learn/resets/12.6-Transformers/app.py new file mode 100644 index 00000000..cb949489 --- /dev/null +++ b/.learn/resets/12.6-Transformers/app.py @@ -0,0 +1,10 @@ +incoming_ajax_data = [ + { "name": 'Mario', "last_name": 'Montes' }, + { "name": 'Joe', "last_name": 'Biden' }, + { "name": 'Bill', "last_name": 'Clon' }, + { "name": 'Hilary', "last_name": 'Mccafee' }, + { "name": 'Bobby', "last_name": 'Mc birth' } +] + +# Your code here + diff --git a/.learn/resets/13-Filter_list/app.py b/.learn/resets/13-Filter_list/app.py new file mode 100644 index 00000000..0f91fe6c --- /dev/null +++ b/.learn/resets/13-Filter_list/app.py @@ -0,0 +1,10 @@ +all_numbers = [23,12,35,5,3,2,3,54,3,21,534,23,42,1] + + +def filter_function(item): + # Update here + return item % 2 == 1 + +greater_than_ten = list(filter(filter_function, all_numbers)) + +print(greater_than_ten) diff --git a/.learn/resets/13.1-Filter_and_list/app.py b/.learn/resets/13.1-Filter_and_list/app.py new file mode 100644 index 00000000..b9e376e0 --- /dev/null +++ b/.learn/resets/13.1-Filter_and_list/app.py @@ -0,0 +1,9 @@ +all_names = ["Romario", "Boby", "Roosevelt", "Emiliy", "Michael", "Greta", "Patricia", "Danzalee"] + +# Your code here + +print(resulting_names) + + + + diff --git a/.learn/resets/13.2-filter_done_tasks/app.py b/.learn/resets/13.2-filter_done_tasks/app.py new file mode 100644 index 00000000..2a69b63f --- /dev/null +++ b/.learn/resets/13.2-filter_done_tasks/app.py @@ -0,0 +1,14 @@ +tasks = [ + { "label": 'Eat my lunch', "done": True }, + { "label": 'Make the bed', "done": False }, + { "label": 'Have some fun', "done": False }, + { "label": 'Finish the replits', "done": False }, + { "label": 'Replit the finishes', "done": True }, + { "label": 'Ask for a raise', "done": False }, + { "label": 'Read a book', "done": True }, + { "label": 'Make a trip', "done": False } +] + + +# Your code here + diff --git a/.learn/resets/13.3-Filter_list_strings/app.py b/.learn/resets/13.3-Filter_list_strings/app.py new file mode 100644 index 00000000..af96ba6c --- /dev/null +++ b/.learn/resets/13.3-Filter_list_strings/app.py @@ -0,0 +1,3 @@ +names = ['Liam','Emma','Noah','Olivia','William','Ava','James','Isabella','Logan','Sophia','Benjamin','Mia','Mason','Charlotte','Elijah','Amelia','Oliver','Evelyn','Jacob','Abigail','Lucas','Harper','Michael','Emily','Alexander','Elizabeth','Ethan','Avery','Daniel','Sofia','Matthew','Ella','Aiden','Madison','Henry','Scarlett','Joseph','Victoria','Jackson','Aria','Samuel','Grace','Sebastian','Chloe','David','Camila','Carter','Penelope','Wyatt','Riley'] + +# Your code here diff --git a/.learn/resets/13.4-Making_HTML_with_filter_and_maP/app.py b/.learn/resets/13.4-Making_HTML_with_filter_and_maP/app.py new file mode 100644 index 00000000..979857d7 --- /dev/null +++ b/.learn/resets/13.4-Making_HTML_with_filter_and_maP/app.py @@ -0,0 +1,12 @@ +all_colors = [ + {"label": 'Red', "sexy": True}, + {"label": 'Pink', "sexy": False}, + {"label": 'Orange', "sexy": True}, + {"label": 'Brown', "sexy": False}, + {"label": 'Pink', "sexy": True}, + {"label": 'Violet', "sexy": True}, + {"label": 'Purple', "sexy": False}, +] + +# Your code here + diff --git a/.learn/resets/14-Loop-dictionary/app.py b/.learn/resets/14-Loop-dictionary/app.py new file mode 100644 index 00000000..8903bfb0 --- /dev/null +++ b/.learn/resets/14-Loop-dictionary/app.py @@ -0,0 +1,7 @@ +spanish_translations = { "dog": "perro", "house": "casa", "cat": "gato" } +# Your code here + + +# Don't touch the code below +print("Translation:", spanish_translations["dog"]) +print(spanish_translations) diff --git a/.learn/resets/14.1-letter_counter/app.py b/.learn/resets/14.1-letter_counter/app.py new file mode 100644 index 00000000..f4708592 --- /dev/null +++ b/.learn/resets/14.1-letter_counter/app.py @@ -0,0 +1,8 @@ +par = "Lorem ipsum dolor sit amet consectetur adipiscing elit Curabitur eget bibendum turpis Curabitur scelerisque eros ultricies venenatis mi at tempor nisl Integer tincidunt accumsan cursus" + +counts = {} + +# Your code here + + +print(counts) diff --git a/.learn/resets/15.1-Matrix_Builder/app.py b/.learn/resets/15.1-Matrix_Builder/app.py new file mode 100644 index 00000000..fce62c1d --- /dev/null +++ b/.learn/resets/15.1-Matrix_Builder/app.py @@ -0,0 +1 @@ +# Your code here diff --git a/.learn/resets/15.2-Parking_lot_check/app.py b/.learn/resets/15.2-Parking_lot_check/app.py new file mode 100644 index 00000000..e6f445f8 --- /dev/null +++ b/.learn/resets/15.2-Parking_lot_check/app.py @@ -0,0 +1,7 @@ +parking_state = [ + [1,1,1], + [0,0,0], + [1,1,2] +] + +# Your code here diff --git a/.learn/resets/16-Techno_beat/app.py b/.learn/resets/16-Techno_beat/app.py new file mode 100644 index 00000000..5442b529 --- /dev/null +++ b/.learn/resets/16-Techno_beat/app.py @@ -0,0 +1,8 @@ + + +# Your code above, nothing to change after this line +print(lyrics_generator([0,0,1,1,0,0,0])) +print(lyrics_generator([0,0,1,1,1,0,0,0])) +print(lyrics_generator([0,0,0])) +print(lyrics_generator([1,0,1])) +print(lyrics_generator([1,1,1])) diff --git a/exercises/01-hello-world/app.py b/exercises/01-hello-world/app.py index fce62c1d..a9b76882 100644 --- a/exercises/01-hello-world/app.py +++ b/exercises/01-hello-world/app.py @@ -1 +1,2 @@ # Your code here +print("Hello World") \ No newline at end of file diff --git a/exercises/01.1-Access-and-Retrieve/app.py b/exercises/01.1-Access-and-Retrieve/app.py index 250261b7..66c7895e 100644 --- a/exercises/01.1-Access-and-Retrieve/app.py +++ b/exercises/01.1-Access-and-Retrieve/app.py @@ -1,7 +1,8 @@ my_list = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] # 1. Print the 3rd item here - +print(my_list[2]) # 2. Change the value of 'thursday' to None - +my_list[4] = None # 3. Print that position now here +print(my_list[4]) \ No newline at end of file diff --git a/exercises/01.2-Retrieve-items/app.py b/exercises/01.2-Retrieve-items/app.py index 9208b3cd..1e9d549e 100644 --- a/exercises/01.2-Retrieve-items/app.py +++ b/exercises/01.2-Retrieve-items/app.py @@ -1,5 +1,6 @@ my_list = [4,5,734,43,45,100,4,56,23,67,23,58,45,3,100,4,56,23] # Print in the console the 1st element on the list - +print(my_list[0]) # Print in the console the 4th element on the list +print(my_list[3]) \ No newline at end of file diff --git a/exercises/01.3-Print-the-last-one/app.py b/exercises/01.3-Print-the-last-one/app.py index 68fa5b25..fc3e9ece 100644 --- a/exercises/01.3-Print-the-last-one/app.py +++ b/exercises/01.3-Print-the-last-one/app.py @@ -14,3 +14,5 @@ def generate_random_list(): # Write your code below this comment, good luck! +the_last_one = len(my_stupid_list) +print(the_last_one) \ No newline at end of file diff --git a/exercises/01.4-loop-seventeen/app.py b/exercises/01.4-loop-seventeen/app.py index 0bdc85b5..9b229ba5 100644 --- a/exercises/01.4-loop-seventeen/app.py +++ b/exercises/01.4-loop-seventeen/app.py @@ -1 +1,3 @@ # Your code here, have fun: +for i in range(0,18): + print(i) \ No newline at end of file diff --git a/exercises/01.5-Add-item-to-list/app.py b/exercises/01.5-Add-item-to-list/app.py index c74ded5f..14fd602a 100644 --- a/exercises/01.5-Add-item-to-list/app.py +++ b/exercises/01.5-Add-item-to-list/app.py @@ -1,5 +1,12 @@ # Remember to import random function here +import random my_list = [4, 5, 734, 43, 45] # The magic goes below + +for i in range(10): + numbers = random.randint(1, 100) + my_list.append(numbers) + +print(my_list) \ No newline at end of file diff --git a/exercises/02-Loop-list/app.py b/exercises/02-Loop-list/app.py index 13b3228b..42f19d72 100644 --- a/exercises/02-Loop-list/app.py +++ b/exercises/02-Loop-list/app.py @@ -2,3 +2,6 @@ # Your code here print(my_list[0]) + +for item in my_list: + print(item) \ No newline at end of file diff --git a/exercises/02.1-Loop-from-the-top/app.py b/exercises/02.1-Loop-from-the-top/app.py index 1442ea68..a8bbeae6 100644 --- a/exercises/02.1-Loop-from-the-top/app.py +++ b/exercises/02.1-Loop-from-the-top/app.py @@ -2,5 +2,5 @@ # Modify the loop below to print from end to start -for i in range(0, len(my_sample_list)): +for i in range(len(my_sample_list) -1, -1, -1): print(my_sample_list[i]) diff --git a/exercises/02.2-Loop-adding-two/app.py b/exercises/02.2-Loop-adding-two/app.py index 2a2a5f60..54240ae1 100644 --- a/exercises/02.2-Loop-adding-two/app.py +++ b/exercises/02.2-Loop-adding-two/app.py @@ -2,6 +2,6 @@ # Your code below, don't change anything above -for i in range(0, len(my_sample_list), 1): +for i in range(0, len(my_sample_list), 2): print(my_sample_list[i]) diff --git a/exercises/02.3-loop-from-the-half-to-the-end/app.py b/exercises/02.3-loop-from-the-half-to-the-end/app.py index a2cf3175..7e144c60 100644 --- a/exercises/02.3-loop-from-the-half-to-the-end/app.py +++ b/exercises/02.3-loop-from-the-half-to-the-end/app.py @@ -1,9 +1,9 @@ my_list = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12] # Your code here -inicial_value = 0 -stop_value = 0 -increase_value = 0 +inicial_value = 7 +stop_value = 14 +increase_value = 1 for i in range(inicial_value, stop_value, increase_value): print(my_list[i]) diff --git a/exercises/02.4-One_last_looping/app.py b/exercises/02.4-One_last_looping/app.py index 0607676f..1cf242a1 100644 --- a/exercises/02.4-One_last_looping/app.py +++ b/exercises/02.4-One_last_looping/app.py @@ -1,3 +1,9 @@ names = ['Esmeralda','Kiko','Ruth','Lebron','Pedro','Maria','Lou','Fernando','Cesco','Bart','Annie'] # Your code here +names[1] = "Steven" +names[-1] ="Pepe" +names[0] = names[2] + names[4] + +for i in range(len(names)-1, -1, -1): + print(names[i]) \ No newline at end of file diff --git a/exercises/02.5-Finding_wally/app.py b/exercises/02.5-Finding_wally/app.py index 44797d49..db55581e 100644 --- a/exercises/02.5-Finding_wally/app.py +++ b/exercises/02.5-Finding_wally/app.py @@ -1,3 +1,6 @@ people = ['Lebron','Aaliyah','Diamond','Dominique','Aliyah','Jazmin','Darnell','Hatfield','Hawkins','Hayden','Hayes','Haynes','Hays','Head','Heath','Hebert','Henderson','Hendricks','Hendrix','Henry','Hensley','Henson','Herman','Hernandez','Herrera','Herring','Hess','Hester','Hewitt','Hickman','Hicks','Higgins','Hill','Hines','Hinton','Hobbs','Hodge','Hodges','Hoffman','Hogan','Holcomb','Holden','Holder','Holland','Holloway','Holman','Holmes','Holt','Hood','Hooper','Hoover','Hopkins','Hopper','Horn','Horne','Horton','House','Houston','Howard','Howe','Howell','Hubbard','Huber','Hudson','Huff','Wally','Hughes','Hull','Humphrey','Hunt','Hunter','Hurley','Hurst','Hutchinson','Hyde','Ingram','Irwin','Jackson','Jacobs','Jacobson','James','Jarvis','Jefferson','Jenkins','Jennings','Jensen','Jimenez','Johns','Johnson','Johnston','Jones','Jordan','Joseph','Joyce','Joyner','Juarez','Justice','Kane','Kaufman','Keith','Keller','Kelley','Kelly','Kemp','Kennedy','Kent','Kerr','Key','Kidd','Kim','King','Kinney','Kirby','Kirk','Kirkland','Klein','Kline','Knapp','Knight','Knowles','Knox','Koch','Kramer','Lamb','Lambert','Lancaster','Landry','Lane','Lang','Langley','Lara','Larsen','Larson','Lawrence','Lawson','Le','Leach','Leblanc','Lee','Leon','Leonard','Lester','Levine','Levy','Lewis','Lindsay','Lindsey','Little','Livingston','Lloyd','Logan','Long','Lopez','Lott','Love','Lowe','Lowery','Lucas','Luna','Lynch','Lynn','Lyons','Macdonald','Macias','Mack','Madden','Maddox','Maldonado','Malone','Mann','Manning','Marks','Marquez','Marsh','Marshall','Martin','Martinez','Mason','Massey','Mathews','Mathis','Matthews','Maxwell','May','Mayer','Maynard','Mayo','Mays','Mcbride','Mccall','Mccarthy','Mccarty','Mcclain','Mcclure','Mcconnell','Mccormick','Mccoy','Mccray','Wally','Mcdaniel','Mcdonald','Mcdowell','Mcfadden','Mcfarland','Mcgee','Mcgowan','Mcguire','Mcintosh','Mcintyre','Mckay','Mckee','Mckenzie','Mckinney','Mcknight','Mclaughlin','Mclean','Mcleod','Mcmahon','Mcmillan','Mcneil','Mcpherson','Meadows','Medina','Mejia','Melendez','Melton','Mendez','Mendoza','Mercado','Mercer','Merrill','Merritt','Meyer','Meyers','Michael','Middleton','Miles','Miller','Mills','Miranda','Mitchell','Molina','Monroe','Lucas','Jake','Scott','Amy','Molly','Hannah','Lucas'] # Your code here +for i in range(0, len(people)): + if people[i].lower() == "wally": + print(i) \ No newline at end of file diff --git a/exercises/03-flip_list/app.py b/exercises/03-flip_list/app.py index d2f3e18b..18b4432b 100644 --- a/exercises/03-flip_list/app.py +++ b/exercises/03-flip_list/app.py @@ -1,3 +1,9 @@ sample_list = [45, 67, 87, 23, 5, 32, 60] # Your code below +new_list = [] + +for i in range(sample_list[:] -1, -1, -1): + new_list.append((sample_list[i])) + +print(new_list) \ No newline at end of file diff --git a/exercises/04-mixed_list/app.py b/exercises/04-mixed_list/app.py index 3aab4234..02a0d42a 100644 --- a/exercises/04-mixed_list/app.py +++ b/exercises/04-mixed_list/app.py @@ -1,3 +1,6 @@ mix = [42, True, "towel", [2,1], 'hello', 34.4, {"name": "juan"}] # Your code below + +for i in mix: + print(type(i)) \ No newline at end of file diff --git a/exercises/04.1-count_on/app.py b/exercises/04.1-count_on/app.py index c02ec494..6e413624 100644 --- a/exercises/04.1-count_on/app.py +++ b/exercises/04.1-count_on/app.py @@ -1,3 +1,10 @@ my_list = [42, True, "towel", [2,1], 'hello', 34.4, {"name": "juan"}] # Your code here +new_list = [] + +for item in my_list: + if type(item) == dict or type(item) == list: + new_list.append(item) + +print(new_list) \ No newline at end of file diff --git a/exercises/05-Sum_all_items/app.py b/exercises/05-Sum_all_items/app.py index 26582cb2..33603a41 100644 --- a/exercises/05-Sum_all_items/app.py +++ b/exercises/05-Sum_all_items/app.py @@ -1,9 +1,10 @@ my_sample_list = [3423,5,4,47889,654,8,867543,23,48,5345,234,6,78,54,23,67,3,6,432,55,23,25,12] -def sum_all_values(list): +def sum_all_values(item): total = 0 # The magic happens here - + for item in my_sample_list: + total += item return total diff --git a/exercises/05.1-sum_odd_items/app.py b/exercises/05.1-sum_odd_items/app.py index c6f86a84..c1151f50 100644 --- a/exercises/05.1-sum_odd_items/app.py +++ b/exercises/05.1-sum_odd_items/app.py @@ -1,3 +1,11 @@ my_list = [4,5,734,43,45,100,4,56,23,67,23,58,45] # Your code here +def sum_odds(item): + odd_numbers = 0 + for item in my_list: + if item % 2 != 0: + odd_numbers += item + return odd_numbers + +print(sum_odds(my_list)) \ No newline at end of file diff --git a/exercises/06-Print_by_condition/app.py b/exercises/06-Print_by_condition/app.py index de6e8f61..9d373bf0 100644 --- a/exercises/06-Print_by_condition/app.py +++ b/exercises/06-Print_by_condition/app.py @@ -3,4 +3,5 @@ for i in my_list: # The magic happens here - + if i % 14 == 0: + print(i) \ No newline at end of file diff --git a/exercises/06.1-Everything_is_awesome/app.py b/exercises/06.1-Everything_is_awesome/app.py index 4c3d0c26..15c49826 100644 --- a/exercises/06.1-Everything_is_awesome/app.py +++ b/exercises/06.1-Everything_is_awesome/app.py @@ -4,7 +4,10 @@ def my_function(numbers): new_list = [] for i in numbers: # The magic happens here - + if i == 0: + new_list.append("Yahoo") + elif i == 1: + new_list.append(1) return new_list diff --git a/exercises/07-Do_while/app.py b/exercises/07-Do_while/app.py index fce62c1d..337a7f95 100644 --- a/exercises/07-Do_while/app.py +++ b/exercises/07-Do_while/app.py @@ -1 +1,12 @@ # Your code here + +item = 20 + +while item >= 1: + if item % 5 == 0: + print(str(item) + "!") + else: + print(item) + item -= 1 + +print("LIFTOFF") \ No newline at end of file diff --git a/exercises/08-Delete_element/app.py b/exercises/08-Delete_element/app.py index 36514c4d..03a8d2ab 100644 --- a/exercises/08-Delete_element/app.py +++ b/exercises/08-Delete_element/app.py @@ -1,10 +1,14 @@ people = ['juan','ana','michelle','daniella','stefany','lucy','barak'] def delete_person(person_name): - # Your code here + new_people = [] - + for person in people[:]: + if person != person_name: + new_people.append(person) + return new_people + # Don't delete anything below print(delete_person("daniella")) print(delete_person("juan")) diff --git a/exercises/08.1-Merge_list/app.py b/exercises/08.1-Merge_list/app.py index 6146f098..9d57a6eb 100644 --- a/exercises/08.1-Merge_list/app.py +++ b/exercises/08.1-Merge_list/app.py @@ -4,6 +4,12 @@ def merge_list(list1, list2): # Your code here - + final_list = [] + for i in list1: + final_list.append(i) + for i in list2: + final_list.append(i) + + return final_list print(merge_list(chunk_one, chunk_two)) diff --git a/exercises/08.2-Divide_and_conquer/app.py b/exercises/08.2-Divide_and_conquer/app.py index 106fd02b..ac7c011d 100644 --- a/exercises/08.2-Divide_and_conquer/app.py +++ b/exercises/08.2-Divide_and_conquer/app.py @@ -1,6 +1,20 @@ list_of_numbers = [4, 80, 85, 59, 37, 25, 5, 64, 66, 81, 20, 64, 41, 22, 76, 76, 55, 96, 2, 68] # Your code here +def sort_odd_even(numbers): + sorted_list = [] + even = [] + + for i in numbers: + if i % 2 == 1: + sorted_list.append(i) + elif i % 2 == 0: + even.append(i) + + sorted_list.extend(even) + + return sorted_list + print(sort_odd_even(list_of_numbers)) diff --git a/exercises/09-Max_integer_from_list/app.py b/exercises/09-Max_integer_from_list/app.py index c0a5a543..f0e5be70 100644 --- a/exercises/09-Max_integer_from_list/app.py +++ b/exercises/09-Max_integer_from_list/app.py @@ -1,3 +1,13 @@ my_list = [43,23,6,87,43,1,4,6,3,67,8,3445,3,7,5435,63,346,3,456,734,6,34] # Your code here +def max_integer(list): + max_number = list[0] + + for i in range(0, len(list)): + if list[i] > max_number: + max_number = list[i] + + return max_number + +print(max_integer(my_list)) \ No newline at end of file diff --git a/exercises/09-Max_integer_from_list/solution.hide.py b/exercises/09-Max_integer_from_list/solution.hide.py index a605de60..8a5232fb 100644 --- a/exercises/09-Max_integer_from_list/solution.hide.py +++ b/exercises/09-Max_integer_from_list/solution.hide.py @@ -7,6 +7,7 @@ def max_integer(list): for i in range(len(list)): if list[i] > max_int: max_int = list[i] - return max_int + + return max_int print(max_integer(my_list)) diff --git a/exercises/09.1-For_loop_min_value/app.py b/exercises/09.1-For_loop_min_value/app.py index 594b1d3d..d6ef5290 100644 --- a/exercises/09.1-For_loop_min_value/app.py +++ b/exercises/09.1-For_loop_min_value/app.py @@ -1,3 +1,13 @@ +import random + my_list = [3344,34334,454543,342534,4563456,3445,23455,234,262,2335,43323,4356,345,4545,452,345,434,36,345,4334,5454,345,4352,23,365,345,47,63,425,6578759,768,834,754,35,32,445,453456,56,7536867,3884526,4234,35353245,53244523,566785,7547,743,4324,523472634,26665,63432,54645,32,453625,7568,5669576,754,64356,542644,35,243,371,3251,351223,13231243,734,856,56,53,234342,56,545343] # Your code here + +minimum_integer = my_list[0] + +for i in my_list: + if i < minimum_integer: + minimum_integer = i + +print(minimum_integer) diff --git a/exercises/10-Find_avg/app.py b/exercises/10-Find_avg/app.py index c881b318..702b0ad3 100644 --- a/exercises/10-Find_avg/app.py +++ b/exercises/10-Find_avg/app.py @@ -1,3 +1,12 @@ my_list = [2323,4344,2325,324413,21234,24531,2123,42234,544,456,345,42,5445,23,5656,423] # Your code here + +total = 0 + +for i in my_list: + total += i + +average = total / (len(my_list)) + +print(average) \ No newline at end of file diff --git a/exercises/11-Nested_list/app.py b/exercises/11-Nested_list/app.py index c08ecc4a..304c6cce 100644 --- a/exercises/11-Nested_list/app.py +++ b/exercises/11-Nested_list/app.py @@ -1,3 +1,6 @@ coordinates_list = [[33.747252, -112.633853], [-33.867886, -63.987], [41.303921, -81.901693], [-33.350534, -71.653268]] # Your code here + +for i in coordinates_list: + print(i[1]) \ No newline at end of file diff --git a/exercises/12-Map_a_list/app.py b/exercises/12-Map_a_list/app.py index bbaa6e5d..c420ec57 100644 --- a/exercises/12-Map_a_list/app.py +++ b/exercises/12-Map_a_list/app.py @@ -2,7 +2,7 @@ def celsius_to_fahrenheit(celsius): # The magic happens here - + return (celsius * 9/5) + 32 result = list(map(celsius_to_fahrenheit, celsius_values)) diff --git a/exercises/12.1-more_mapping/app.py b/exercises/12.1-more_mapping/app.py index c5d1ca14..ed813052 100644 --- a/exercises/12.1-more_mapping/app.py +++ b/exercises/12.1-more_mapping/app.py @@ -2,4 +2,10 @@ # Your code here +def multiply_by_three(number): + + return (number * 3) + +new_list = list(map(multiply_by_three, my_numbers)) + print(new_list) diff --git a/exercises/12.2-Map_function_inside_variable/app.py b/exercises/12.2-Map_function_inside_variable/app.py index 7146df37..ae9da7fb 100644 --- a/exercises/12.2-Map_function_inside_variable/app.py +++ b/exercises/12.2-Map_function_inside_variable/app.py @@ -4,3 +4,7 @@ def prepender(name): return "My name is: " + name # Your code here + +new_list = list(map(prepender, names)) + +print(new_list) diff --git a/exercises/12.3-Map_data_types/app.py b/exercises/12.3-Map_data_types/app.py index c1225967..6e9424c8 100644 --- a/exercises/12.3-Map_data_types/app.py +++ b/exercises/12.3-Map_data_types/app.py @@ -2,7 +2,7 @@ def type_list(items): # Your code here - return + return type(items) new_list = list(map(type_list, mixed_list)) diff --git a/exercises/12.4-Map_list_of_objects/app.py b/exercises/12.4-Map_list_of_objects/app.py index de3e0d1f..a1efd3fe 100644 --- a/exercises/12.4-Map_list_of_objects/app.py +++ b/exercises/12.4-Map_list_of_objects/app.py @@ -15,7 +15,9 @@ def calculate_age(date_of_birth): def format_greeting(person): # Your code here - return person["name"] + name = person["name"] + age = calculate_age(person["birth_date"]) + return f"Hello, my name is {name} and I am {age} years old" name_list = list(map(format_greeting, people)) diff --git a/exercises/12.5-Yes_and_no/app.py b/exercises/12.5-Yes_and_no/app.py index bdbe9f38..3ef5f4c1 100644 --- a/exercises/12.5-Yes_and_no/app.py +++ b/exercises/12.5-Yes_and_no/app.py @@ -2,3 +2,5 @@ # Your code here +new_list = list(map(lambda i: "wiki" if i == 1 else "woko", the_bools)) +print(new_list) \ No newline at end of file diff --git a/exercises/12.6-Transformers/app.py b/exercises/12.6-Transformers/app.py index cb949489..95f00035 100644 --- a/exercises/12.6-Transformers/app.py +++ b/exercises/12.6-Transformers/app.py @@ -8,3 +8,7 @@ # Your code here +def data_transformer(data_list): + return list(map(lambda element: f"{element['name']} {element['last_name']}", data_list)) + +print(data_transformer(incoming_ajax_data)) \ No newline at end of file diff --git a/exercises/13-Filter_list/app.py b/exercises/13-Filter_list/app.py index 0f91fe6c..b7dbf791 100644 --- a/exercises/13-Filter_list/app.py +++ b/exercises/13-Filter_list/app.py @@ -3,7 +3,7 @@ def filter_function(item): # Update here - return item % 2 == 1 + return item > 10 greater_than_ten = list(filter(filter_function, all_numbers)) diff --git a/exercises/13.1-Filter_and_list/app.py b/exercises/13.1-Filter_and_list/app.py index b9e376e0..77b7ecd6 100644 --- a/exercises/13.1-Filter_and_list/app.py +++ b/exercises/13.1-Filter_and_list/app.py @@ -1,6 +1,10 @@ all_names = ["Romario", "Boby", "Roosevelt", "Emiliy", "Michael", "Greta", "Patricia", "Danzalee"] # Your code here +def filter_function(name): + return name[0].lower() == "r" + +resulting_names = list(filter(filter_function, all_names)) print(resulting_names) diff --git a/exercises/13.2-filter_done_tasks/app.py b/exercises/13.2-filter_done_tasks/app.py index 2a69b63f..4e95b5d4 100644 --- a/exercises/13.2-filter_done_tasks/app.py +++ b/exercises/13.2-filter_done_tasks/app.py @@ -9,6 +9,11 @@ { "label": 'Make a trip', "done": False } ] - # Your code here +def filter_function(task): + return task["done"] + +done_task = list(filter(filter_function, tasks)) + +print(done_task) \ No newline at end of file diff --git a/exercises/13.3-Filter_list_strings/app.py b/exercises/13.3-Filter_list_strings/app.py index af96ba6c..562783f0 100644 --- a/exercises/13.3-Filter_list_strings/app.py +++ b/exercises/13.3-Filter_list_strings/app.py @@ -1,3 +1,7 @@ names = ['Liam','Emma','Noah','Olivia','William','Ava','James','Isabella','Logan','Sophia','Benjamin','Mia','Mason','Charlotte','Elijah','Amelia','Oliver','Evelyn','Jacob','Abigail','Lucas','Harper','Michael','Emily','Alexander','Elizabeth','Ethan','Avery','Daniel','Sofia','Matthew','Ella','Aiden','Madison','Henry','Scarlett','Joseph','Victoria','Jackson','Aria','Samuel','Grace','Sebastian','Chloe','David','Camila','Carter','Penelope','Wyatt','Riley'] # Your code here + +new_list = list(filter(lambda name: "am" in name.lower(), names)) + +print(new_list) \ No newline at end of file diff --git a/exercises/13.4-Making_HTML_with_filter_and_maP/app.py b/exercises/13.4-Making_HTML_with_filter_and_maP/app.py index 979857d7..a6d290ed 100644 --- a/exercises/13.4-Making_HTML_with_filter_and_maP/app.py +++ b/exercises/13.4-Making_HTML_with_filter_and_maP/app.py @@ -9,4 +9,13 @@ ] # Your code here +def generate_li(color): + return f"