Skip to content

Commit 7a9bdf3

Browse files
committed
second
1 parent 13306a5 commit 7a9bdf3

File tree

11 files changed

+79
-7
lines changed

11 files changed

+79
-7
lines changed
Lines changed: 6 additions & 0 deletions
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()
Lines changed: 5 additions & 0 deletions
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()
Lines changed: 23 additions & 0 deletions
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())
Lines changed: 17 additions & 0 deletions
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())
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Your code here!!
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Your code here!
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
def standards_maker():
22
#your code here
3-
4-
#remember to call the function outside (here)
3+
4+
for i in range(0, 300):
5+
if i<=300:
6+
print("I will write questions if I am stuck")
7+
#remember to call the function outside (here)
8+
standards_maker()

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
def fizz_buzz():
22
# your code here
3+
for i in range(1,101):
4+
if i%15 == 0:
5+
print('FizzBuzz')
6+
elif i%5 == 0:
7+
print('Buzz')
8+
elif i%3==0:
9+
print('Fizz')
10+
else:
11+
print(i)
12+
313

414

515
fizz_buzz()

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

Lines changed: 5 additions & 0 deletions
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(1,11):
22+
example_color = get_color(random.randint(0, 3))
23+
students_array.append(example_color)
24+
25+
return students_array
2126

2227

2328
print(get_allStudentColors())

0 commit comments

Comments
 (0)