diff --git a/1-hello-world/01_setting_up.py b/1-hello-world/01_setting_up.py
new file mode 100644
index 0000000..4ac8144
--- /dev/null
+++ b/1-hello-world/01_setting_up.py
@@ -0,0 +1,3 @@
+# Write code below 💖
+
+print('Hi')
diff --git a/1-hello-world/02_hello_world.py b/1-hello-world/02_hello_world.py
index 60f08aa..73fb7c3 100644
--- a/1-hello-world/02_hello_world.py
+++ b/1-hello-world/02_hello_world.py
@@ -1 +1 @@
-print('Hello world!')
+print('Hello World!')
diff --git a/1-hello-world/04_initials.py b/1-hello-world/04_initials.py
index 57a2076..9e60c6d 100644
--- a/1-hello-world/04_initials.py
+++ b/1-hello-world/04_initials.py
@@ -1,4 +1,4 @@
-# Fun fact: My high school band Attica was signed to an indie record label.
+# Fun fact: My high school band Attica was signed to an indie record label. 🤘
print(' SSS L ')
print('S S L ')
diff --git a/1-hello-world/05_letter.py b/1-hello-world/05_letter.py
index fed0003..e2998bd 100644
--- a/1-hello-world/05_letter.py
+++ b/1-hello-world/05_letter.py
@@ -1,17 +1,26 @@
# Snail Mail 💌
# Codédex
-print('+---------------------------------------------------------------------+')
-print('| June 2022 |')
-print('| Brooklyn, NY |')
-print('| Dear Self, |')
-print('| |')
-print('| Build the learn to code platform that you always dreamed of. |')
-print('| Give more than you take. |')
-print('| Care > capital. |')
-print('| Five-second funerals for all the Ls. |')
-print('| And always get back up. |')
-print('| |')
-print('| Sonny Li 🤠 |')
-print('| |')
-print('+---------------------------------------------------------------------+')
+print('+---------------------------------------------------------------------------------+')
+print('| |')
+print('| October 2025 |')
+print('| Brooklyn, NY |')
+print('| Dear Self, |')
+print('| |')
+print('| Does great art require suffering? |')
+print('| Does great product demand capital? |')
+print('| Did you find any truth at the end of the road? |')
+print('| |')
+print('| Regardless, go build the learning platform you’ve always dreamed of — |')
+print('| the one you wish existed when you first started. |')
+print('| |')
+print('| Give more than you take. |')
+print('| Take only what you need. |')
+print('| |')
+print('| And when things fall apart, get tf back up. |')
+print('| |')
+print('| - Sonny Li |')
+print('| |')
+print('| P.S. Hope I made you proud. You got this, kiddo. 🤠 |')
+print('| |')
+print('+---------------------------------------------------------------------------------+')
diff --git a/1-hello-world/05_letter_2.py b/1-hello-world/05_letter_2.py
new file mode 100644
index 0000000..d3076b1
--- /dev/null
+++ b/1-hello-world/05_letter_2.py
@@ -0,0 +1,19 @@
+# Snail Mail 💌
+# Codédex
+
+print('+---------------------------------------------------------------------+')
+print('| |')
+print('| |')
+print('| Wrote myself a letter |')
+print('| just a single question |')
+print('| |')
+print('| "When you finally get this, where will you be?" ✨ |')
+print('| |')
+print('| Will you be a shipwreck or a star |')
+print('| Falling for a boy who doesn\'t play guitar? |')
+print('| Now rewind the tape back to the start |')
+print('| |')
+print('| - Caroline Polachek |')
+print('| |')
+print('| |')
+print('+---------------------------------------------------------------------+')
diff --git a/1-hello-world/hello_world.mov b/1-hello-world/hello_world.mov
deleted file mode 100644
index a05b542..0000000
Binary files a/1-hello-world/hello_world.mov and /dev/null differ
diff --git a/2-variables/09_hypotenuse.py b/2-variables/09_hypotenuse.py
index 9b1894f..eb6b9e7 100644
--- a/2-variables/09_hypotenuse.py
+++ b/2-variables/09_hypotenuse.py
@@ -1,4 +1,4 @@
-# Pythagorean Theroem 📐
+# Pythagorean Theorem 📐
# Codédex
a = int(input("Enter a: "))
diff --git a/3-control-flow/16_sorting_hat_1.py b/3-control-flow/16_sorting_hat_1.py
index c1547dc..9355579 100644
--- a/3-control-flow/16_sorting_hat_1.py
+++ b/3-control-flow/16_sorting_hat_1.py
@@ -20,11 +20,11 @@
answer = int(input('Enter answer (1-2): '))
if answer == 1:
- gryffindor += 1
- ravenclaw += 1
+ gryffindor = gryffindor + 1
+ ravenclaw = ravenclaw + 1
elif answer == 2:
- hufflepuff += 1
- slytherin +=1
+ hufflepuff = hufflepuff + 1
+ slytherin = slytherin + 1
else:
print('Wrong input.')
@@ -40,13 +40,13 @@
answer = int(input('Enter your answer (1-4): '))
if answer == 1:
- hufflepuff += 2
+ hufflepuff = hufflepuff + 2
elif answer == 2:
- slytherin += 2
+ slytherin = slytherin + 2
elif answer == 3:
- ravenclaw += 2
+ ravenclaw = ravenclaw + 2
elif answer == 4:
- gryffindor += 2
+ gryffindor = gryffindor + 2
else:
print('Wrong input.')
@@ -62,13 +62,13 @@
answer = int(input('Enter your answer (1-4): '))
if answer == 1:
- slytherin += 4
+ slytherin = slytherin + 4
elif answer == 2:
- hufflepuff += 4
+ hufflepuff = hufflepuff + 4
elif answer == 3:
- ravenclaw +=4
+ ravenclaw = ravenclaw + 4
elif answer == 4:
- gryffindor += 4
+ gryffindor = gryffindor + 4
else:
print('Wrong input.')
@@ -77,13 +77,13 @@
print("Hufflepuff: ", hufflepuff)
print("Slytherin: ", slytherin)
-most_points = max(gryffindor, ravenclaw, hufflepuff, slytherin) # We'll learn about max() in the Functions chapter
+# Bonus Part
-if gryffindor == most_points:
+if gryffindor >= ravenclaw and gryffindor >= hufflepuff and gryffindor >= slytherin:
print('🦁 Gryffindor!')
-elif ravenclaw == most_points:
+elif ravenclaw >= hufflepuff and ravenclaw >= slytherin:
print('🦅 Ravenclaw!')
-elif hufflepuff == most_points:
+elif hufflepuff >= slytherin:
print('🦡 Hufflepuff!')
else:
print('🐍 Slytherin!')
diff --git a/3-control-flow/16_sorting_hat_2.py b/3-control-flow/16_sorting_hat_2.py
index 55692c1..be56f5c 100644
--- a/3-control-flow/16_sorting_hat_2.py
+++ b/3-control-flow/16_sorting_hat_2.py
@@ -77,11 +77,15 @@
print("Hufflepuff: ", hufflepuff)
print("Slytherin: ", slytherin)
-if gryffindor >= ravenclaw and gryffindor >= hufflepuff and gryffindor >= slytherin:
+# Bonus Part
+
+most_points = max(gryffindor, ravenclaw, hufflepuff, slytherin) # We'll learn about the max() function in Chapter 6
+
+if gryffindor == most_points:
print('🦁 Gryffindor!')
-elif ravenclaw >= hufflepuff and ravenclaw >= slytherin:
+elif ravenclaw == most_points:
print('🦅 Ravenclaw!')
-elif hufflepuff >= slytherin:
+elif hufflepuff == most_points:
print('🦡 Hufflepuff!')
else:
- print('🐍 Slytherin!')
\ No newline at end of file
+ print('🐍 Slytherin!')
diff --git a/4-loops/18_guess_number.py b/4-loops/18_guess_number.py
index cfbb6c0..1597cad 100644
--- a/4-loops/18_guess_number.py
+++ b/4-loops/18_guess_number.py
@@ -5,7 +5,7 @@
tries = 0
while guess != 6 and tries < 5:
- guess = int(input('Guess the number: '))
+ guess = int(input('Guess the number: '))
tries = tries + 1
if guess != 6:
diff --git a/5-lists/24_inventory.py b/5-lists/24_inventory.py
index 99f001c..1c1cb5a 100644
--- a/5-lists/24_inventory.py
+++ b/5-lists/24_inventory.py
@@ -1,7 +1,7 @@
# Inventory 📦
# Codédex
-airplane_toys = [ 898, 732, 543, 878 ]
+lego_parts = [8980, 7323, 5343, 82700, 92232, 1203, 7319, 8903, 2328, 1279, 679, 589]
-print(min(airplane_toys))
-print(max(airplane_toys))
+print(min(lego_parts))
+print(max(lego_parts))
diff --git a/5-lists/25_reading_list.py b/5-lists/25_reading_list.py
index 9a9d646..07ace1e 100644
--- a/5-lists/25_reading_list.py
+++ b/5-lists/25_reading_list.py
@@ -1,16 +1,16 @@
# Reading List 📚
# Codédex
-books = ['Zero to One',
- 'The Lean Startup',
+books = ['Harry Potter',
+ '1984',
+ 'The Fault in Our Stars',
'The Mom Test',
- 'Made to Stick',
'Life in Code']
print(books)
-books.append('Zero to Sold')
-books.remove('Zero to One')
-books.pop(0)
+books.append('Pachinko')
+books.remove('The Fault in Our Stars')
+books.pop(1)
print(books)
diff --git a/5-lists/27_bucket_list.py b/5-lists/27_bucket_list.py
index ea7fae1..e734a0a 100644
--- a/5-lists/27_bucket_list.py
+++ b/5-lists/27_bucket_list.py
@@ -1,13 +1,13 @@
-# Bucket List: Jerry Zhu
+# Bucket List 🪣
# Codédex
things_to_do = [
- '🚀 Build a menaingful product for everyone.',
- '⛰ Try out hiking and mountain biking.',
- '🌏 Visit at least 10 countries in my lifetime.',
- '🎸 Produce an original song.',
- '📝 Write a short story.',
- '🏃 Finish a 10k marathon.'
+ '🚀 Build a meaningful product for everyone.',
+ '⛰ Try out hiking and mountain biking.',
+ '🌏 Visit at least 10 countries in my lifetime.',
+ '🎸 Produce an original song.',
+ '📝 Write a short story.',
+ '🏃 Finish a 10k marathon.'
]
for thing in things_to_do:
diff --git a/6-functions/30_rocket.py b/6-functions/30_rocket.py
index 306c2eb..d928b41 100644
--- a/6-functions/30_rocket.py
+++ b/6-functions/30_rocket.py
@@ -2,7 +2,7 @@
# Codédex
def distance_to_miles(distance):
- return distance / 1.609
+ miles = distance / 1.609
+ print(miles)
-answer = distance_to_miles(10000)
-print(answer)
+distance_to_miles(10000)
diff --git a/6-functions/32_stonks.py b/6-functions/32_stonks.py
index 7290ebc..d2ba9d6 100644
--- a/6-functions/32_stonks.py
+++ b/6-functions/32_stonks.py
@@ -1,7 +1,7 @@
# Stonks 📈
# Codédex
-stock_prices = [ 6.15, 5.81, 5.70, 5.65, 5.33, 5.62, 5.19, 6.13, 7.20, 7.34, 7.95, 7.53, 7.39, 7.59, 7.27 ]
+stock_prices = [34.68, 36.09, 34.94, 33.97, 34.68, 35.82, 43.41, 44.29, 44.65, 53.56, 49.85, 48.71, 48.71, 49.94, 48.53, 47.03, 46.59, 48.62, 44.21, 47.21]
def price_at(i):
return stock_prices[i-1]
diff --git a/7-classes-objects/34_restaurants.py b/7-classes-objects/34_restaurants.py
index b8e1299..3986bfe 100644
--- a/7-classes-objects/34_restaurants.py
+++ b/7-classes-objects/34_restaurants.py
@@ -3,6 +3,6 @@
class Restaurant:
name = ''
- description = ''
+ category = ''
rating = 0.0
- deliver = True
+ delivery = True
diff --git a/7-classes-objects/35_bobs_burgers.py b/7-classes-objects/35_bobs_burgers.py
index c174dcb..68264cc 100644
--- a/7-classes-objects/35_bobs_burgers.py
+++ b/7-classes-objects/35_bobs_burgers.py
@@ -24,3 +24,7 @@ class Restaurant:
baekjeong.type = 'Korean BBQ'
baekjeong.rating = 4.4
baekjeong.delivery = False
+
+print(vars(bobs_burgers))
+print(vars(katz_deli))
+print(vars(baekjeong))
\ No newline at end of file
diff --git a/7-classes-objects/38_pokedex_1.py b/7-classes-objects/38_pokedex_1.py
index 6b533ee..f11d4a1 100644
--- a/7-classes-objects/38_pokedex_1.py
+++ b/7-classes-objects/38_pokedex_1.py
@@ -31,7 +31,7 @@ def display_details(self):
# Pokémon objects
pikachu = Pokemon(25, 'Pikachu', ['Electric'], 'It has small electric sacs on both its cheeks. If threatened, it looses electric charges from the sacs.', True)
-charizard = Pokemon(3, 'Charizard', ['Fire', 'Flying'], 'It spits fire that is hot enough to melt boulders. It may cause forest fires by blowing flames.', False)
+charizard = Pokemon(6, 'Charizard', ['Fire', 'Flying'], 'It spits fire that is hot enough to melt boulders. It may cause forest fires by blowing flames.', False)
gyarados = Pokemon(130, 'Gyarados', ['Water', 'Flying'], 'It has an extremely aggressive nature. The HYPER BEAM it shoots from its mouth totally incinerates all targets.', False)
pikachu.speak()
diff --git a/7-classes-objects/38_pokedex_2.py b/7-classes-objects/38_pokedex_2.py
index b483644..91c3311 100644
--- a/7-classes-objects/38_pokedex_2.py
+++ b/7-classes-objects/38_pokedex_2.py
@@ -35,7 +35,7 @@ def display_details(self):
# Pokémon objects
pikachu = Pokemon(25, 'Pikachu', ['Electric'], 'It has small electric sacs on both its cheeks. If threatened, it looses electric charges from the sacs.', 25, 'Kanto', True)
-charizard = Pokemon(3, 'Charizard', ['Fire', 'Flying'], 'It spits fire that is hot enough to melt boulders. It may cause forest fires by blowing flames.', 36, 'Kanto', False)
+charizard = Pokemon(6, 'Charizard', ['Fire', 'Flying'], 'It spits fire that is hot enough to melt boulders. It may cause forest fires by blowing flames.', 36, 'Kanto', False)
gyarados = Pokemon(130, 'Gyarados', ['Water', 'Flying'], 'It has an extremely aggressive nature. The HYPER BEAM it shoots from its mouth totally incinerates all targets.', 57, 'Kanto', False)
pikachu.speak()
diff --git a/README.md b/README.md
index fad5185..79b47b8 100644
--- a/README.md
+++ b/README.md
@@ -7,16 +7,18 @@
Welcome to The Legend of Python GitHub repo! We are super excited to have you. Here, you will find all the solutions to the Codédex exercises. Feel free to make pull requests to add your own twists on the exercises!
-### Website: www.codedex.io/python
+### Start the course: www.codedex.io/python
-##
Hello World
+##
1: Hello World
- [`hello_world.py`](https://github.com/codedex-io/python-101/blob/main/1-hello-world/02_hello_world.py)
- [`pattern.py`](https://github.com/codedex-io/python-101/blob/main/1-hello-world/03_pattern.py)
- [`initials.py`](https://github.com/codedex-io/python-101/blob/main/1-hello-world/04_initials.py)
- [`letter.py`](https://github.com/codedex-io/python-101/blob/main/1-hello-world/05_letter.py)
-##
Variables
+Walkthrough video: https://youtube.com/watch?v=ioumu_SC7F8
+
+##
2. Variables
- [`temperature.py`](https://github.com/codedex-io/python-101/blob/main/2-variables/07_temperature.py)
- [`bmi.py`](https://github.com/codedex-io/python-101/blob/main/2-variables/08_bmi.py)
@@ -29,7 +31,8 @@ Welcome to The Legend of Python GitHub repo! We are super excited to have you. H
- [`grades.py`](https://github.com/codedex-io/python-101/blob/main/3-control-flow/12_grades.py)
- [`ph_levels.py`](https://github.com/codedex-io/python-101/blob/main/3-control-flow/13_ph_levels.py)
- [`magic_8_ball.py`](https://github.com/codedex-io/python-101/blob/main/3-control-flow/14_magic_8_ball.py)
-- [`the_cyclone.py`](https://github.com/codedex-io/python-101/blob/main/3-control-flow/15_the_cyclone.py)
+- [`the_cyclone.py`](https://github.com/codedex-io/python-101/blob/main/3-control-flow/15_the_cyclone_1.py) (solution 1)
+- [`the_cyclone.py`](https://github.com/codedex-io/python-101/blob/main/3-control-flow/15_the_cyclone_2.py) (solution 2)
- [`sorting_hat.py`](https://github.com/codedex-io/python-101/blob/main/3-control-flow/16_sorting_hat_1.py) (solution 1)
- [`sorting_hat.py`](https://github.com/codedex-io/python-101/blob/main/3-control-flow/16_sorting_hat_2.py) (solution 2)
@@ -46,7 +49,7 @@ Welcome to The Legend of Python GitHub repo! We are super excited to have you. H
- [`grocery.py`](https://github.com/codedex-io/python-101/blob/main/5-lists/22_grocery.py)
- [`todo.py`](https://github.com/codedex-io/python-101/blob/main/5-lists/23_todo.py)
- [`inventory.py`](https://github.com/codedex-io/python-101/blob/main/5-lists/24_inventory.py)
-- [`reading.py`](https://github.com/codedex-io/python-101/blob/main/5-lists/25_reading.py)
+- [`reading.py`](https://github.com/codedex-io/python-101/blob/main/5-lists/25_reading_list.py)
- [`mixtape.py`](https://github.com/codedex-io/python-101/blob/main/5-lists/26_mixtape.py)
- [`bucket_list.py`](https://github.com/codedex-io/python-101/blob/main/5-lists/27_bucket_list.py)
@@ -66,7 +69,8 @@ Welcome to The Legend of Python GitHub repo! We are super excited to have you. H
- [`bobs_burgers.py`](https://github.com/codedex-io/python-101/blob/main/7-classes-objects/35_bobs_burgers.py)
- [`favorite_cities.py`](https://github.com/codedex-io/python-101/blob/main/7-classes-objects/36_favorite_cities.py)
- [`bank_accounts.py`](https://github.com/codedex-io/python-101/blob/main/7-classes-objects/37_bank_accounts.py)
-- [`pokedex.py`](https://github.com/codedex-io/python-101/blob/main/7-classes-objects/38_pokedex.py)
+- [`pokedex.py`](https://github.com/codedex-io/python-101/blob/main/7-classes-objects/38_pokedex_1.py) (solution 1)
+- [`pokedex.py`](https://github.com/codedex-io/python-101/blob/main/7-classes-objects/38_pokedex_2.py) (solution 2)
##
Modules
diff --git a/projects.md b/projects.md
index 20fd964..6e66f9f 100644
--- a/projects.md
+++ b/projects.md
@@ -4,7 +4,7 @@
- 🥠 Fortune Cookie
- 🎲 Dice Rolling Simulator
-- 🫱 Rock Paper Scisssors
+- 🫱 Rock Paper Scissors
- 🫱 Rock Paper Scissors Lizard Spark
- 🤑 Who Wants to Be a Millionaire
- ❓ Quiz Game