Skip to content

Práctica de list & loops in python #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
done till 8.2
  • Loading branch information
danderi committed Nov 12, 2024
commit 2dc108c70b79386e86d58c5776bdc11f05b0b2c5
16 changes: 16 additions & 0 deletions .learn/resets/01.3-Print-the-last-one/app.py
Original file line number Diff line number Diff line change
@@ -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!

1 change: 1 addition & 0 deletions .learn/resets/01.4-loop-seventeen/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here, have fun:
5 changes: 5 additions & 0 deletions .learn/resets/01.5-Add-item-to-list/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Remember to import random function here

my_list = [4, 5, 734, 43, 45]

# The magic goes below
4 changes: 4 additions & 0 deletions .learn/resets/02-Loop-list/app.py
Original file line number Diff line number Diff line change
@@ -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])
6 changes: 6 additions & 0 deletions .learn/resets/02.1-Loop-from-the-top/app.py
Original file line number Diff line number Diff line change
@@ -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])
7 changes: 7 additions & 0 deletions .learn/resets/02.2-Loop-adding-two/app.py
Original file line number Diff line number Diff line change
@@ -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])

9 changes: 9 additions & 0 deletions .learn/resets/02.3-loop-from-the-half-to-the-end/app.py
Original file line number Diff line number Diff line change
@@ -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])
3 changes: 3 additions & 0 deletions .learn/resets/02.4-One_last_looping/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
names = ['Esmeralda','Kiko','Ruth','Lebron','Pedro','Maria','Lou','Fernando','Cesco','Bart','Annie']

# Your code here
3 changes: 3 additions & 0 deletions .learn/resets/02.5-Finding_wally/app.py
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .learn/resets/03-flip_list/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sample_list = [45, 67, 87, 23, 5, 32, 60]

# Your code below
3 changes: 3 additions & 0 deletions .learn/resets/04-mixed_list/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mix = [42, True, "towel", [2,1], 'hello', 34.4, {"name": "juan"}]

# Your code below
3 changes: 3 additions & 0 deletions .learn/resets/04.1-count_on/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
my_list = [42, True, "towel", [2,1], 'hello', 34.4, {"name": "juan"}]

# Your code here
10 changes: 10 additions & 0 deletions .learn/resets/05-Sum_all_items/app.py
Original file line number Diff line number Diff line change
@@ -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))
3 changes: 3 additions & 0 deletions .learn/resets/05.1-sum_odd_items/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
my_list = [4,5,734,43,45,100,4,56,23,67,23,58,45]

# Your code here
6 changes: 6 additions & 0 deletions .learn/resets/06-Print_by_condition/app.py
Original file line number Diff line number Diff line change
@@ -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

11 changes: 11 additions & 0 deletions .learn/resets/06.1-Everything_is_awesome/app.py
Original file line number Diff line number Diff line change
@@ -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))
1 change: 1 addition & 0 deletions .learn/resets/07-Do_while/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
11 changes: 11 additions & 0 deletions .learn/resets/08-Delete_element/app.py
Original file line number Diff line number Diff line change
@@ -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"))
9 changes: 9 additions & 0 deletions .learn/resets/08.1-Merge_list/app.py
Original file line number Diff line number Diff line change
@@ -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))
7 changes: 7 additions & 0 deletions .learn/resets/08.2-Divide_and_conquer/app.py
Original file line number Diff line number Diff line change
@@ -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))

3 changes: 3 additions & 0 deletions .learn/resets/09-Max_integer_from_list/app.py
Original file line number Diff line number Diff line change
@@ -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