Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions .learn/resets/01-Console/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# print "Hello World!" on the console
print 'Hello world'
1 change: 1 addition & 0 deletions .learn/resets/02-Declare-Variables/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# ✅ ↓ your code here ↓ ✅
1 change: 1 addition & 0 deletions .learn/resets/03-Print-Variables-In-The-Console/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# ✅ ↓ your code here ↓ ✅
1 change: 1 addition & 0 deletions .learn/resets/04-Multiply-Two-Values/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# ✅ ↓ your code here ↓ ✅
4 changes: 4 additions & 0 deletions .learn/resets/05-User-Inputed-Values/app.py
Original file line number Diff line number Diff line change
@@ -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))
6 changes: 6 additions & 0 deletions .learn/resets/06-String-Concatenation/app.py
Original file line number Diff line number Diff line change
@@ -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)
13 changes: 13 additions & 0 deletions .learn/resets/07-Create-a-Basic-HTML/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
a = '</title>'
b = '</html>'
c = '<head>'
d = '</body>'
e = '<html>'
f = '</head>'
g = '<title>'
h = '<body>'

# ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌

# ✅ ↓ start coding below here ↓ ✅

3 changes: 3 additions & 0 deletions .learn/resets/08.1-Your-First-If/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
total = int(input('How much money do you have in your pocket\n'))

# ✅ ↓ YOUR CODE HERE ↓ ✅
12 changes: 12 additions & 0 deletions .learn/resets/08.2-How-Much-The-Wedding-Costs/app.py
Original file line number Diff line number Diff line change
@@ -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')
8 changes: 8 additions & 0 deletions .learn/resets/09-Random-Numbers/app.py
Original file line number Diff line number Diff line change
@@ -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())
6 changes: 6 additions & 0 deletions .learn/resets/10-Calling-Your-First-Function/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def is_odd(my_number):
return (my_number % 2 != 0)


def my_main_code():
# ✅ ↓ Your code here ↓ ✅
6 changes: 6 additions & 0 deletions .learn/resets/10.1-Creating-Your-First-Function/app.py
Original file line number Diff line number Diff line change
@@ -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))
3 changes: 3 additions & 0 deletions .learn/resets/11-Create-A-New-Function/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import random

# ✅↓ Write your code here ↓✅
8 changes: 8 additions & 0 deletions .learn/resets/12-Rand-From-One-to-Twelve/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import random

def get_randomInt():
# ✅↓ Write your code here ↓✅
return None

# ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌
print(get_randomInt())
6 changes: 6 additions & 0 deletions .learn/resets/13-Your-First-Loop/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def start_counting():
for i in range(10):
print(i)
return i

start_counting()
5 changes: 5 additions & 0 deletions .learn/resets/14-Create-A-For-Loop/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def standards_maker():
# ✅↓ Write your code here ↓✅


# ✅↓ remember to call the function outside (here) ↓✅
5 changes: 5 additions & 0 deletions .learn/resets/15-Looping-With-FizzBuzz/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def fizz_buzz():
# ✅↓ Write your code here ↓✅

# ❌↓ DON'T CHANGE THE CODE BELOW ↓❌
fizz_buzz()
25 changes: 25 additions & 0 deletions .learn/resets/16-Random-Colors-Loop/app.py
Original file line number Diff line number Diff line change
@@ -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())
15 changes: 15 additions & 0 deletions .learn/resets/17-Russian-Roulette/app.py
Original file line number Diff line number Diff line change
@@ -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())
2 changes: 2 additions & 0 deletions .learn/resets/18-The-Beatles/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ✅↓ Write your code here ↓✅

1 change: 1 addition & 0 deletions .learn/resets/19-Bottles-Of-Milk/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# ✅↓ Write your code here ↓✅
3 changes: 2 additions & 1 deletion exercises/01-Console/app.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# print "Hello World!" on the console
# print "Hello World!" on the console
print('Hello World!')
3 changes: 3 additions & 0 deletions exercises/02-Declare-Variables/app.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# ✅ ↓ your code here ↓ ✅
color = "Yellow"
print (color)

5 changes: 4 additions & 1 deletion exercises/03-Print-Variables-In-The-Console/app.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# ✅ ↓ your code here ↓ ✅
# ✅ ↓ your code here ↓ ✅
color = "red"
item = "marker"
print(color, item)
2 changes: 2 additions & 0 deletions exercises/04-Multiply-Two-Values/app.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# ✅ ↓ your code here ↓ ✅
variables_are_cool = 2345 * 7323
print(variables_are_cool)
2 changes: 1 addition & 1 deletion exercises/05-User-Inputed-Values/app.py
Original file line number Diff line number Diff line change
@@ -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))
print("Your age is: "+str(age+10))
3 changes: 2 additions & 1 deletion exercises/06-String-Concatenation/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +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
Expand Down
2 changes: 2 additions & 0 deletions exercises/07-Create-a-Basic-HTML/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@

# ✅ ↓ start coding below here ↓ ✅

html_document= e+c+g+a+f+h+d+b
print (html_document)
8 changes: 8 additions & 0 deletions exercises/08.1-Your-First-If/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
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!")
else:
print("You are a poor guy, go away!")


7 changes: 7 additions & 0 deletions exercises/08.2-How-Much-The-Wedding-Costs/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
price = 4000
# ✅ ↓ Your code here ↓ ✅

elif user_input <= 100 and user_input > 50:
price = 10000
elif user_input <= 200 and user_input > 100:
price = 15000
else:
price = 20000


# ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌
print('Your wedding will cost '+str(price)+' dollars')
2 changes: 1 addition & 1 deletion exercises/09-Random-Numbers/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
4 changes: 3 additions & 1 deletion exercises/10-Calling-Your-First-Function/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ def is_odd(my_number):


def my_main_code():
# ✅ ↓ Your code here ↓ ✅
# ✅ ↓ Your code here ↓ ✅
par = is_odd(45345)
print (par)
2 changes: 1 addition & 1 deletion exercises/10.1-Creating-Your-First-Function/app.py
Original file line number Diff line number Diff line change
@@ -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))
4 changes: 4 additions & 0 deletions exercises/11-Create-A-New-Function/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import random

# ✅↓ Write your code here ↓✅

def generate_random():
return random.randint(0,9)

2 changes: 1 addition & 1 deletion exercises/12-Rand-From-One-to-Twelve/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
2 changes: 1 addition & 1 deletion exercises/13-Your-First-Loop/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def start_counting():
for i in range(10):
for i in range(12):
print(i)
return i

Expand Down
3 changes: 3 additions & 0 deletions exercises/14-Create-A-For-Loop/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
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()
16 changes: 16 additions & 0 deletions exercises/15-Looping-With-FizzBuzz/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
def fizz_buzz():
# ✅↓ Write your code here ↓✅
for i in range (1,101):
if i%3 == 0 and i%5 ==0:
print ("FizzBuzz")


elif i % 5 == 0:
print ("Buzz")
elif i % 3 == 0:
print ("Fizz")

else:
print (i)





# ❌↓ DON'T CHANGE THE CODE BELOW ↓❌
fizz_buzz()
8 changes: 8 additions & 0 deletions exercises/16-Random-Colors-Loop/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ def get_allStudentColors():
example_color = get_color(1)
students_array = []
# ✅ ↓ your loop here ↓ ✅

for i in range (1, 11):
r= random.randint(0,3)
students_array.append(get_color(r))
return students_array





print(get_allStudentColors())
11 changes: 10 additions & 1 deletion exercises/17-Russian-Roulette/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ def spin_chamber():
# ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌
def fire_gun():
# ✅ ↓ your code here ↓ ✅
return None


if bullet_position==spin_chamber():

return ("You are dead")
else :
return ("Keep playing")





print(fire_gun())
14 changes: 14 additions & 0 deletions exercises/18-The-Beatles/app.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# ✅↓ Write your code here ↓✅


def sing():
for i in range (4):
print ("let it be,")
print ("there will be an answer,")
for i in range (5):
print ("let it be,")
print ("whisper words of wisdom, let it be")

sing()




2 changes: 1 addition & 1 deletion exercises/18-The-Beatles/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ def test_function_hardcode_output():
@pytest.mark.it("The function sing() should return a string with the song lyrics")
def test_function_sing_exists(app):
try:
assert app.sing() == "let it be,\nlet it be,\nlet it be,\nlet it be,\nthere will be an answer,\nlet it be,\nlet it be,\nlet it be,\nlet it be,\nlet it be,\nwhisper words of wisdom, let it be"
assert app.sing() == " nlet it be,\nlet it be,\nthere will be an answer,\nlet it be,\nlet it be,\nlet it be,\nlet it be,\nlet it be,\nwhisper words of wisdom, let it be"
except AttributeError:
raise AttributeError("The function 'sing' should exist on app.py")
10 changes: 10 additions & 0 deletions exercises/19-Bottles-Of-Milk/app.py
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# ✅↓ Write your code here ↓✅
def number_of_bottles():
for i in range (99, 2, -1):
print (f' {i} bottles of milk on the wall, {i} bottles of milk \n Take one down and pass it around, {i-1} bottles of milk on the wall.')

print (f' 2 bottles of milk on the wall, 2 bottles of milk \n Take one down and pass it around, 1 bottle of milk on the wall.')
print (f'1 bottle of milk , 1 bottle of milk.\n Take one down and pass it around, no more bottles of milk')
print (f'No more bottles of milk on the wall, no more bottles of milk.')
print (f'Go to the store and buy some more, 99 bottles of milk on the wall.')
return None
number_of_bottles()