Skip to content

Commit 4b8cc06

Browse files
committed
first commit
1 parent da23c4b commit 4b8cc06

File tree

42 files changed

+205
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+205
-12
lines changed

.learn/resets/01-Console/app.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# print "Hello World!" on the console
2+
print("Hello World!")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# your code here
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#your code here
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# your code here
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
age = int(input('What is your age?\n'))
2+
# CHANGE THE CODE BELOW TO ADD 10 TO AGE
3+
4+
print("Your age is: "+str(age))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Set the values for my_var1 and my_var2 here
2+
3+
4+
## Don't change below this line
5+
the_new_string = my_var1+' '+my_var2
6+
print(the_new_string)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
a = '</title>'
2+
b = '</html>'
3+
c = '<head>'
4+
d = '</body>'
5+
e = '<html>'
6+
f = '</head>'
7+
g = '<title>'
8+
h = '<body>'
9+
10+
# ⬆ DON'T CHANGE THE CODE ABOVE ⬆
11+
# ↓ start coding below here ↓
12+
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
total = int(input('How much money do you have in your pocket\n'))
2+
3+
# YOUR CODE HERE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
user_input = int(input('How many people are coming to your wedding?\n'))
2+
3+
if user_input <= 50:
4+
price = 4000
5+
6+
print('Your wedding will cost '+str(price)+' dollars')
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import random
2+
3+
def get_randomInt():
4+
# CHANGE ONLY THIS LINE BELOW
5+
random_number = random.random()
6+
return random_number
7+
8+
print(get_randomInt())
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def is_odd(my_number):
2+
return (my_number % 2 != 0)
3+
4+
5+
def my_main_code():
6+
# your code here
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def addNumbers(a,b):
2+
# This is the function body. Write your code here.
3+
4+
5+
# Do not change the code below
6+
print(addNumbers(3,4))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import random
2+
3+
# your code here
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import random
2+
3+
def get_randomInt():
4+
# Your code here
5+
return None
6+
7+
print(get_randomInt())
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def standards_maker():
2+
#your code here
3+
4+
#remember to call the function outside (here)
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def start_counting():
2+
for i in range(10):
3+
print(i)
4+
return i
5+
6+
start_counting()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def fizz_buzz():
2+
# your code here
3+
4+
5+
fizz_buzz()
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import random
2+
3+
def get_color(color_number=4):
4+
# making sure is a number and not a string
5+
color_number = int(color_number)
6+
7+
switcher={
8+
0:'red',
9+
1:'yellow',
10+
2:'blue',
11+
3:'green',
12+
4:'black'
13+
}
14+
return switcher.get(color_number,"Invalid Color Number")
15+
16+
17+
def get_allStudentColors():
18+
example_color = get_color(1)
19+
students_array = []
20+
#your loop here
21+
22+
23+
print(get_allStudentColors())
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import random
2+
3+
bullet_position = 3
4+
5+
def spin_chamber():
6+
chamber_position = random.randint(1,6)
7+
return chamber_position
8+
9+
# DON'T CHANGE THE CODE ABOVE
10+
def fire_gun():
11+
# YOUR CODE HERE
12+
return None
13+
14+
15+
16+
17+
print(fire_gun())

.learn/resets/18-The-Beatles/app.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Your code here!!
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Your code here!

exercises/01-Console/app.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
# print "Hello World!" on the console
1+
# print "Hello World!" on the console
2+
print("Hello World!")

exercises/02-Declare-Variables/app.py

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
# your code here
2+
vars = "Yellow"
3+
4+
print(vars)
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
#your code here
1+
#your code here
2+
color= "red"
3+
4+
print(color)
+8
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
11
# your code here
2+
3+
4+
5+
6+
variables_are_cool= 2345 * 7323
7+
8+
print(variables_are_cool)
9+
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
age = int(input('What is your age?\n'))
22
# CHANGE THE CODE BELOW TO ADD 10 TO AGE
33

4-
print("Your age is: "+str(age))
4+
5+
print("Your age is: "+str(age + 10 ) )

exercises/06-String-Concatenation/app.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Set the values for my_var1 and my_var2 here
2+
my_var1= "Hello"
3+
my_var2= "World"
4+
25

36

47
## Don't change below this line

exercises/07-Create-a-Basic-HTML/app.py

+3
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010
# ⬆ DON'T CHANGE THE CODE ABOVE ⬆
1111
# ↓ start coding below here ↓
1212

13+
html_document = e + c + g + a + f + h + d + b
14+
print(html_document)
15+

exercises/08.1-Your-First-If/app.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
total = int(input('How much money do you have in your pocket\n'))
22

33
# YOUR CODE HERE
4+
5+
if total > 100: print("Give me your money!")
6+
elif total >50: print("Buy me some coffee you cheap!")
7+
elif total <= 50: print("You are a poor guy, go away!")

exercises/08.2-How-Much-The-Wedding-Costs/app.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22

33
if user_input <= 50:
44
price = 4000
5-
5+
elif user_input <= 100:
6+
price= 10000
7+
elif user_input <= 200:
8+
price= 15000
9+
else: price=20000
610
print('Your wedding will cost '+str(price)+' dollars')

exercises/09-Random-Numbers/app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
def get_randomInt():
44
# CHANGE ONLY THIS LINE BELOW
5-
random_number = random.random()
5+
random_number = random.randint(1 , 10)
66
return random_number
77

88
print(get_randomInt())

exercises/10-Calling-Your-First-Function/app.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@ def is_odd(my_number):
33

44

55
def my_main_code():
6-
# your code here
6+
# your code here
7+
print(is_odd(45345))
8+
9+
10+
11+
print(my_main_code)
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def addNumbers(a,b):
22
# This is the function body. Write your code here.
3-
3+
return a + b
44

55
# Do not change the code below
66
print(addNumbers(3,4))
+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
import random
22

3-
# your code here
3+
# your code here
4+
def generate_random():
5+
return(random.randrange(10))
6+
7+
print(generate_random())

exercises/12-Rand-From-One-to-Twelve/app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
def get_randomInt():
44
# Your code here
5-
return None
5+
return(random.randrange(1, 13))
66

77
print(get_randomInt())

exercises/13-Create-A-For-Loop/app.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
def standards_maker():
22
#your code here
3+
for i in range(0, 300):
4+
print("I will write questions if I am stuck")
35

4-
#remember to call the function outside (here)
6+
#remember to call the function outside (here)
7+
8+
standards_maker()

exercises/14-Your-First-Loop/app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
def start_counting():
2-
for i in range(10):
2+
for i in range(12):
33
print(i)
44
return i
55

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
def fizz_buzz():
22
# your code here
3+
for i in range(1, 101):
4+
if i %3 == 0 and i %5 == 0: print("FizzBuzz")
5+
elif i %3 == 0: print("Fizz")
6+
elif i %5 == 0: print("Buzz")
7+
else: print(i)
8+
39

410

511
fizz_buzz()

exercises/16-Random-Colors-Loop/app.py

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ def get_allStudentColors():
1818
example_color = get_color(1)
1919
students_array = []
2020
#your loop here
21+
for i in range(10):
22+
ran_color = random.randint(0 , 3)
23+
color= get_color(ran_color)
24+
students_array.append(color)
2125

26+
return students_array
2227

2328
print(get_allStudentColors())

exercises/17-Russian-Roulette/app.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ def spin_chamber():
99
# DON'T CHANGE THE CODE ABOVE
1010
def fire_gun():
1111
# YOUR CODE HERE
12-
return None
12+
if spin_chamber == bullet_position:
13+
return("You are dead!")
14+
else:
15+
return("Keep playing!")
1316

1417

1518

exercises/18-The-Beatles/app.py

+10
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
# Your code here!!
2+
def sing():
3+
for i in range(8):
4+
if i == 4:
5+
print("whisper words of wisdom, let it be, let it be,")
6+
else: print("let it be,")
7+
print("there will be an answer, let it be")
8+
9+
sing()
10+
11+

exercises/19-Bottles-Of-Milk/app.py

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
# Your code here!
2+
def number_of_bottles():
3+
for i in range(100, 0):
4+

0 commit comments

Comments
 (0)