diff --git a/.learn/resets/01-Console/app.py b/.learn/resets/01-Console/app.py new file mode 100644 index 00000000..ff00ab34 --- /dev/null +++ b/.learn/resets/01-Console/app.py @@ -0,0 +1 @@ +# print "Hello World!" on the console \ No newline at end of file diff --git a/.learn/resets/02-Declare-Variables/app.py b/.learn/resets/02-Declare-Variables/app.py new file mode 100644 index 00000000..83e80593 --- /dev/null +++ b/.learn/resets/02-Declare-Variables/app.py @@ -0,0 +1 @@ +# ✅ ↓ your code here ↓ ✅ diff --git a/.learn/resets/03-Print-Variables-In-The-Console/app.py b/.learn/resets/03-Print-Variables-In-The-Console/app.py new file mode 100644 index 00000000..f62f6922 --- /dev/null +++ b/.learn/resets/03-Print-Variables-In-The-Console/app.py @@ -0,0 +1 @@ +# ✅ ↓ your code here ↓ ✅ \ No newline at end of file diff --git a/.learn/resets/04-Multiply-Two-Values/app.py b/.learn/resets/04-Multiply-Two-Values/app.py new file mode 100644 index 00000000..83e80593 --- /dev/null +++ b/.learn/resets/04-Multiply-Two-Values/app.py @@ -0,0 +1 @@ +# ✅ ↓ your code here ↓ ✅ diff --git a/.learn/resets/05-User-Inputed-Values/app.py b/.learn/resets/05-User-Inputed-Values/app.py new file mode 100644 index 00000000..b569ee62 --- /dev/null +++ b/.learn/resets/05-User-Inputed-Values/app.py @@ -0,0 +1,4 @@ +age = int(input('What is your age?\n')) +# ✅ ↓ CHANGE THE CODE BELOW TO ADD 10 TO AGE ↓ ✅ + +print("Your age is: "+str(age)) \ No newline at end of file diff --git a/.learn/resets/06-String-Concatenation/app.py b/.learn/resets/06-String-Concatenation/app.py new file mode 100644 index 00000000..97521fb2 --- /dev/null +++ b/.learn/resets/06-String-Concatenation/app.py @@ -0,0 +1,6 @@ +# ✅ ↓ Set the values for my_var1 and my_var2 here ↓ ✅ + + +## Don't change anything below this line +the_new_string = my_var1 + ' ' + my_var2 +print(the_new_string) diff --git a/.learn/resets/07-Create-a-Basic-HTML/app.py b/.learn/resets/07-Create-a-Basic-HTML/app.py new file mode 100644 index 00000000..ab15ceb0 --- /dev/null +++ b/.learn/resets/07-Create-a-Basic-HTML/app.py @@ -0,0 +1,13 @@ +a = '' +b = '' +c = '' +d = '' +e = '' +f = '' +g = '' +h = '<body>' + +# ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ + +# ✅ ↓ start coding below here ↓ ✅ + diff --git a/.learn/resets/08.1-Your-First-If/app.py b/.learn/resets/08.1-Your-First-If/app.py new file mode 100644 index 00000000..6928dd3f --- /dev/null +++ b/.learn/resets/08.1-Your-First-If/app.py @@ -0,0 +1,3 @@ +total = int(input('How much money do you have in your pocket\n')) + +# ✅ ↓ YOUR CODE HERE ↓ ✅ diff --git a/.learn/resets/08.2-How-Much-The-Wedding-Costs/app.py b/.learn/resets/08.2-How-Much-The-Wedding-Costs/app.py new file mode 100644 index 00000000..ad0a1008 --- /dev/null +++ b/.learn/resets/08.2-How-Much-The-Wedding-Costs/app.py @@ -0,0 +1,12 @@ +user_input = int(input('How many people are coming to your wedding?\n')) + +# ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ + + +if user_input <= 50: + price = 4000 +# ✅ ↓ Your code here ↓ ✅ + + +# ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ +print('Your wedding will cost '+str(price)+' dollars') \ No newline at end of file diff --git a/.learn/resets/09-Random-Numbers/app.py b/.learn/resets/09-Random-Numbers/app.py new file mode 100644 index 00000000..9e4d5316 --- /dev/null +++ b/.learn/resets/09-Random-Numbers/app.py @@ -0,0 +1,8 @@ +import random + +def get_randomInt(): + # ✅ ↓ CHANGE ONLY THIS ONE LINE BELOW ↓ ✅ + random_number = random.random() + return random_number + +print(get_randomInt()) \ No newline at end of file diff --git a/.learn/resets/10-Calling-Your-First-Function/app.py b/.learn/resets/10-Calling-Your-First-Function/app.py new file mode 100644 index 00000000..7e7dd0aa --- /dev/null +++ b/.learn/resets/10-Calling-Your-First-Function/app.py @@ -0,0 +1,6 @@ +def is_odd(my_number): + return (my_number % 2 != 0) + + +def my_main_code(): + # ✅ ↓ Your code here ↓ ✅ \ No newline at end of file diff --git a/.learn/resets/10.1-Creating-Your-First-Function/app.py b/.learn/resets/10.1-Creating-Your-First-Function/app.py new file mode 100644 index 00000000..4db5352c --- /dev/null +++ b/.learn/resets/10.1-Creating-Your-First-Function/app.py @@ -0,0 +1,6 @@ +def add_numbers(a,b): + # This is the function's body ✅↓ Write your code here ↓✅ + + +# ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ +print(add_numbers(3,4)) diff --git a/.learn/resets/11-Create-A-New-Function/app.py b/.learn/resets/11-Create-A-New-Function/app.py new file mode 100644 index 00000000..46b20099 --- /dev/null +++ b/.learn/resets/11-Create-A-New-Function/app.py @@ -0,0 +1,3 @@ +import random + +# ✅↓ Write your code here ↓✅ diff --git a/.learn/resets/12-Rand-From-One-to-Twelve/app.py b/.learn/resets/12-Rand-From-One-to-Twelve/app.py new file mode 100644 index 00000000..d7304410 --- /dev/null +++ b/.learn/resets/12-Rand-From-One-to-Twelve/app.py @@ -0,0 +1,8 @@ +import random + +def get_randomInt(): + # ✅↓ Write your code here ↓✅ + return None + +# ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ +print(get_randomInt()) diff --git a/.learn/resets/13-Your-First-Loop/app.py b/.learn/resets/13-Your-First-Loop/app.py new file mode 100644 index 00000000..542b4980 --- /dev/null +++ b/.learn/resets/13-Your-First-Loop/app.py @@ -0,0 +1,6 @@ +def start_counting(): + for i in range(10): + print(i) + return i + +start_counting() \ No newline at end of file diff --git a/.learn/resets/14-Create-A-For-Loop/app.py b/.learn/resets/14-Create-A-For-Loop/app.py new file mode 100644 index 00000000..19631c70 --- /dev/null +++ b/.learn/resets/14-Create-A-For-Loop/app.py @@ -0,0 +1,5 @@ +def standards_maker(): + # ✅↓ Write your code here ↓✅ + + +# ✅↓ remember to call the function outside (here) ↓✅ diff --git a/.learn/resets/15-Looping-With-FizzBuzz/app.py b/.learn/resets/15-Looping-With-FizzBuzz/app.py new file mode 100644 index 00000000..fff86955 --- /dev/null +++ b/.learn/resets/15-Looping-With-FizzBuzz/app.py @@ -0,0 +1,5 @@ +def fizz_buzz(): + # ✅↓ Write your code here ↓✅ + +# ❌↓ DON'T CHANGE THE CODE BELOW ↓❌ +fizz_buzz() diff --git a/.learn/resets/16-Random-Colors-Loop/app.py b/.learn/resets/16-Random-Colors-Loop/app.py new file mode 100644 index 00000000..0e29ead7 --- /dev/null +++ b/.learn/resets/16-Random-Colors-Loop/app.py @@ -0,0 +1,25 @@ +import random + +def get_color(color_number=4): + # Making sure is a number and not a string + color_number = int(color_number) + + switcher = { + 0:'red', + 1:'yellow', + 2:'blue', + 3:'green', + 4:'black' + } + + return switcher.get(color_number,"Invalid Color Number") + +# ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ + +def get_allStudentColors(): + example_color = get_color(1) + students_array = [] + # ✅ ↓ your loop here ↓ ✅ + + +print(get_allStudentColors()) diff --git a/.learn/resets/17-Russian-Roulette/app.py b/.learn/resets/17-Russian-Roulette/app.py new file mode 100644 index 00000000..e8704639 --- /dev/null +++ b/.learn/resets/17-Russian-Roulette/app.py @@ -0,0 +1,15 @@ +import random + +bullet_position = 3 + +def spin_chamber(): + chamber_position = random.randint(1,6) + return chamber_position + +# ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ +def fire_gun(): + # ✅ ↓ your code here ↓ ✅ + return None + + +print(fire_gun()) diff --git a/.learn/resets/18-The-Beatles/app.py b/.learn/resets/18-The-Beatles/app.py new file mode 100644 index 00000000..d87e6fa1 --- /dev/null +++ b/.learn/resets/18-The-Beatles/app.py @@ -0,0 +1,2 @@ +# ✅↓ Write your code here ↓✅ + diff --git a/.learn/resets/19-Bottles-Of-Milk/app.py b/.learn/resets/19-Bottles-Of-Milk/app.py new file mode 100644 index 00000000..9733b0fc --- /dev/null +++ b/.learn/resets/19-Bottles-Of-Milk/app.py @@ -0,0 +1 @@ +# ✅↓ Write your code here ↓✅ diff --git a/exercises/01-Console/app.py b/exercises/01-Console/app.py index ff00ab34..6cac611d 100644 --- a/exercises/01-Console/app.py +++ b/exercises/01-Console/app.py @@ -1 +1,2 @@ -# print "Hello World!" on the console \ No newline at end of file +# print "Hello World!" on the console +print ("Hello World!") \ No newline at end of file diff --git a/exercises/02-Declare-Variables/app.py b/exercises/02-Declare-Variables/app.py index 83e80593..1f7b89a7 100644 --- a/exercises/02-Declare-Variables/app.py +++ b/exercises/02-Declare-Variables/app.py @@ -1 +1,3 @@ # ✅ ↓ your code here ↓ ✅ +name = "Yellow" +print(name) \ No newline at end of file diff --git a/exercises/03-Print-Variables-In-The-Console/app.py b/exercises/03-Print-Variables-In-The-Console/app.py index f62f6922..b052b862 100644 --- a/exercises/03-Print-Variables-In-The-Console/app.py +++ b/exercises/03-Print-Variables-In-The-Console/app.py @@ -1 +1,5 @@ -# ✅ ↓ your code here ↓ ✅ \ No newline at end of file +# ✅ ↓ your code here ↓ ✅ +color = 'red' +item = "marker" + +print(color, item) \ No newline at end of file diff --git a/exercises/04-Multiply-Two-Values/app.py b/exercises/04-Multiply-Two-Values/app.py index 83e80593..25253fc1 100644 --- a/exercises/04-Multiply-Two-Values/app.py +++ b/exercises/04-Multiply-Two-Values/app.py @@ -1 +1,5 @@ # ✅ ↓ your code here ↓ ✅ + +variables_are_cool = 2345 * 7323 + +print(variables_are_cool) \ No newline at end of file diff --git a/exercises/05-User-Inputed-Values/app.py b/exercises/05-User-Inputed-Values/app.py index b569ee62..271d3ab7 100644 --- a/exercises/05-User-Inputed-Values/app.py +++ b/exercises/05-User-Inputed-Values/app.py @@ -1,4 +1,4 @@ age = int(input('What is your age?\n')) # ✅ ↓ CHANGE THE CODE BELOW TO ADD 10 TO AGE ↓ ✅ -print("Your age is: "+str(age)) \ No newline at end of file +print("Your age is: "+str(age+10)) \ No newline at end of file diff --git a/exercises/06-String-Concatenation/app.py b/exercises/06-String-Concatenation/app.py index 97521fb2..fda86d45 100644 --- a/exercises/06-String-Concatenation/app.py +++ b/exercises/06-String-Concatenation/app.py @@ -1,6 +1,6 @@ # ✅ ↓ Set the values for my_var1 and my_var2 here ↓ ✅ - - +my_var1 = 'Hello' +my_var2 = 'World' ## Don't change anything below this line the_new_string = my_var1 + ' ' + my_var2 print(the_new_string) diff --git a/exercises/07-Create-a-Basic-HTML/app.py b/exercises/07-Create-a-Basic-HTML/app.py index ab15ceb0..c4e65195 100644 --- a/exercises/07-Create-a-Basic-HTML/app.py +++ b/exercises/07-Create-a-Basic-HTML/app.py @@ -10,4 +10,6 @@ # ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ # ✅ ↓ start coding below here ↓ ✅ +html_document = e + c + g + a + f + h + d + b +print (html_document) diff --git a/exercises/08.1-Your-First-If/app.py b/exercises/08.1-Your-First-If/app.py index 6928dd3f..c84ebb68 100644 --- a/exercises/08.1-Your-First-If/app.py +++ b/exercises/08.1-Your-First-If/app.py @@ -1,3 +1,9 @@ total = int(input('How much money do you have in your pocket\n')) # ✅ ↓ YOUR CODE HERE ↓ ✅ +if total > 100 : + print ('Give me your money!') +elif total > 50 : + print ('Buy me some coffee, you cheap!') +elif total <= 50 : + print ('You are a poor guy, go away!') \ No newline at end of file diff --git a/exercises/08.2-How-Much-The-Wedding-Costs/app.py b/exercises/08.2-How-Much-The-Wedding-Costs/app.py index ad0a1008..b2ba65e7 100644 --- a/exercises/08.2-How-Much-The-Wedding-Costs/app.py +++ b/exercises/08.2-How-Much-The-Wedding-Costs/app.py @@ -6,7 +6,12 @@ if user_input <= 50: price = 4000 # ✅ ↓ Your code here ↓ ✅ - +elif user_input <= 100: + price = 10000 +elif user_input <= 200: + price = 15000 +elif user_input > 200: + price = 20000 # ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ print('Your wedding will cost '+str(price)+' dollars') \ No newline at end of file diff --git a/exercises/09-Random-Numbers/app.py b/exercises/09-Random-Numbers/app.py index 9e4d5316..2185481c 100644 --- a/exercises/09-Random-Numbers/app.py +++ b/exercises/09-Random-Numbers/app.py @@ -2,7 +2,7 @@ def get_randomInt(): # ✅ ↓ CHANGE ONLY THIS ONE LINE BELOW ↓ ✅ - random_number = random.random() + random_number = random.randint(1, 10) return random_number print(get_randomInt()) \ No newline at end of file diff --git a/exercises/10-Calling-Your-First-Function/app.py b/exercises/10-Calling-Your-First-Function/app.py index 7e7dd0aa..a2f2aadd 100644 --- a/exercises/10-Calling-Your-First-Function/app.py +++ b/exercises/10-Calling-Your-First-Function/app.py @@ -3,4 +3,5 @@ def is_odd(my_number): def my_main_code(): - # ✅ ↓ Your code here ↓ ✅ \ No newline at end of file + # ✅ ↓ Your code here ↓ ✅ + print (is_odd(45345)) \ No newline at end of file diff --git a/exercises/10.1-Creating-Your-First-Function/app.py b/exercises/10.1-Creating-Your-First-Function/app.py index 4db5352c..2d72fdd1 100644 --- a/exercises/10.1-Creating-Your-First-Function/app.py +++ b/exercises/10.1-Creating-Your-First-Function/app.py @@ -1,6 +1,6 @@ def add_numbers(a,b): # This is the function's body ✅↓ Write your code here ↓✅ - + return a + b # ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ print(add_numbers(3,4)) diff --git a/exercises/11-Create-A-New-Function/app.py b/exercises/11-Create-A-New-Function/app.py index 46b20099..b3d29919 100644 --- a/exercises/11-Create-A-New-Function/app.py +++ b/exercises/11-Create-A-New-Function/app.py @@ -1,3 +1,9 @@ import random # ✅↓ Write your code here ↓✅ +def generate_random (): + randnum = random.randint(0, 9) + print (randnum) + return randnum + +generate_random() diff --git a/exercises/12-Rand-From-One-to-Twelve/app.py b/exercises/12-Rand-From-One-to-Twelve/app.py index d7304410..d1b273b3 100644 --- a/exercises/12-Rand-From-One-to-Twelve/app.py +++ b/exercises/12-Rand-From-One-to-Twelve/app.py @@ -2,7 +2,7 @@ def get_randomInt(): # ✅↓ Write your code here ↓✅ - return None + return random.randrange(1, 13) # ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ print(get_randomInt()) diff --git a/exercises/13-Your-First-Loop/app.py b/exercises/13-Your-First-Loop/app.py index 542b4980..2cc62064 100644 --- a/exercises/13-Your-First-Loop/app.py +++ b/exercises/13-Your-First-Loop/app.py @@ -1,5 +1,5 @@ def start_counting(): - for i in range(10): + for i in range(12): print(i) return i diff --git a/exercises/14-Create-A-For-Loop/app.py b/exercises/14-Create-A-For-Loop/app.py index 19631c70..34912e2b 100644 --- a/exercises/14-Create-A-For-Loop/app.py +++ b/exercises/14-Create-A-For-Loop/app.py @@ -1,5 +1,7 @@ def standards_maker(): # ✅↓ Write your code here ↓✅ - + for i in range (300): + print ("I will ask questions if I am stuck") # ✅↓ remember to call the function outside (here) ↓✅ +standards_maker() \ No newline at end of file diff --git a/exercises/15-Looping-With-FizzBuzz/app.py b/exercises/15-Looping-With-FizzBuzz/app.py index fff86955..ddc55644 100644 --- a/exercises/15-Looping-With-FizzBuzz/app.py +++ b/exercises/15-Looping-With-FizzBuzz/app.py @@ -1,5 +1,13 @@ def fizz_buzz(): # ✅↓ Write your code here ↓✅ - + for i in range (1, 101): + if i % 3 == 0 and i % 5 != 0 : + print ("Fizz") + elif i % 5 == 0 and i % 3 != 0: + print ("Buzz") + elif i % 3 == 0 and i % 5 == 0: + print ("FizzBuzz") + else: + print(i) # ❌↓ DON'T CHANGE THE CODE BELOW ↓❌ fizz_buzz() diff --git a/exercises/16-Random-Colors-Loop/app.py b/exercises/16-Random-Colors-Loop/app.py index 0e29ead7..598a1112 100644 --- a/exercises/16-Random-Colors-Loop/app.py +++ b/exercises/16-Random-Colors-Loop/app.py @@ -20,6 +20,8 @@ def get_allStudentColors(): example_color = get_color(1) students_array = [] # ✅ ↓ your loop here ↓ ✅ - - + for i in range (10): + randnum = random.randint(0, 3) + students_array.append(get_color(randnum)) + return students_array print(get_allStudentColors()) diff --git a/exercises/17-Russian-Roulette/app.py b/exercises/17-Russian-Roulette/app.py index e8704639..f95a5574 100644 --- a/exercises/17-Russian-Roulette/app.py +++ b/exercises/17-Russian-Roulette/app.py @@ -9,7 +9,12 @@ def spin_chamber(): # ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ def fire_gun(): # ✅ ↓ your code here ↓ ✅ - return None - + bullet = spin_chamber() + for i in range (6): + if bullet == i: + fire = "You are dead!" + else: + fire = "Keep playing!" + return fire print(fire_gun()) diff --git a/exercises/18-The-Beatles/app.py b/exercises/18-The-Beatles/app.py index d87e6fa1..1a953e81 100644 --- a/exercises/18-The-Beatles/app.py +++ b/exercises/18-The-Beatles/app.py @@ -1,2 +1,17 @@ # ✅↓ Write your code here ↓✅ +def sing(): + lyrics = "" + for i in range (11): + if i == 4: + lyrics += "there will be an answer,\n" + elif i == 10: + lyrics += "whisper words of wisdom, let it be" + else: + lyrics += "let it be,\n" + + print (lyrics) + + return lyrics + +sing() \ No newline at end of file diff --git a/exercises/19-Bottles-Of-Milk/app.py b/exercises/19-Bottles-Of-Milk/app.py index 9733b0fc..8aafb8e6 100644 --- a/exercises/19-Bottles-Of-Milk/app.py +++ b/exercises/19-Bottles-Of-Milk/app.py @@ -1 +1,15 @@ # ✅↓ Write your code here ↓✅ +def number_of_bottles(): + numberOfBottles = 99 + for i in range(numberOfBottles, 0, -1): + bottle_word = "bottle" if numberOfBottles == 1 else "bottles" + + if numberOfBottles == 1: + print (f"{numberOfBottles} {bottle_word} of milk on the wall, {numberOfBottles} {bottle_word} of milk. Take one down and pass it around, no more bottles of milk on the wall.") + print ("No more bottles of milk on the wall, no more bottles of milk. Go to the store and buy some more, 99 bottles of milk on the wall.") + else: + single_word = "bottle" if numberOfBottles - 1 == 1 else "bottles" + print(f"{numberOfBottles} {bottle_word} of milk on the wall, {numberOfBottles} {bottle_word} of milk. Take one down and pass it around, {numberOfBottles - 1} {single_word} of milk on the wall.") + + numberOfBottles -= 1 +number_of_bottles() \ No newline at end of file