Skip to content

Commit 4917c9d

Browse files
committed
Finished
1 parent ea514a9 commit 4917c9d

File tree

10 files changed

+83
-2
lines changed

10 files changed

+83
-2
lines changed
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
spanish_translations = { "dog": "perro", "house": "casa", "cat": "gato" }
2+
# Your code here
3+
4+
5+
# Don't touch the code below
6+
print("Translation:", spanish_translations["dog"])
7+
print(spanish_translations)
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
par = "Lorem ipsum dolor sit amet consectetur adipiscing elit Curabitur eget bibendum turpis Curabitur scelerisque eros ultricies venenatis mi at tempor nisl Integer tincidunt accumsan cursus"
2+
3+
counts = {}
4+
5+
# Your code here
6+
7+
8+
print(counts)
+1
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,7 @@
1+
parking_state = [
2+
[1,1,1],
3+
[0,0,0],
4+
[1,1,2]
5+
]
6+
7+
# Your code here

.learn/resets/16-Techno_beat/app.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
3+
# Your code above, nothing to change after this line
4+
print(lyrics_generator([0,0,1,1,0,0,0]))
5+
print(lyrics_generator([0,0,1,1,1,0,0,0]))
6+
print(lyrics_generator([0,0,0]))
7+
print(lyrics_generator([1,0,1]))
8+
print(lyrics_generator([1,1,1]))

exercises/14-Loop-dictionary/app.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
spanish_translations = { "dog": "perro", "house": "casa", "cat": "gato" }
22
# Your code here
3-
3+
spanish_translations["love"] = "amor"
4+
spanish_translations["code"] = "codigo"
5+
spanish_translations["smart"] = "inteligente"
46

57
# Don't touch the code below
68
print("Translation:", spanish_translations["dog"])

exercises/14.1-letter_counter/app.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
counts = {}
44

55
# Your code here
6-
6+
par = par.lower()
7+
for letter in par:
8+
if letter == " ":
9+
continue
10+
elif letter in counts:
11+
counts[letter] += 1
12+
else:
13+
counts[letter] = 1
714

815
print(counts)

exercises/15.1-Matrix_Builder/app.py

+11
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
11
# Your code here
2+
def matrix_builder(num):
3+
matrix = []
4+
matrix_sub = []
5+
for i in range(num):
6+
for j in range(num):
7+
matrix_sub.append(1)
8+
matrix.append(matrix_sub)
9+
matrix_sub = []
10+
return matrix
11+
12+
print(matrix_builder(5))

exercises/15.2-Parking_lot_check/app.py

+16
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,19 @@
55
]
66

77
# Your code here
8+
def get_parking_lot(parking):
9+
state = {
10+
"total_slots": 0,
11+
"available_slots": 0,
12+
"occupied_slots": 0
13+
}
14+
for spaces in parking:
15+
for space in spaces:
16+
if space == 1:
17+
state["total_slots"] += 1
18+
state["occupied_slots"] += 1
19+
elif space == 2:
20+
state["total_slots"] += 1
21+
state["available_slots"] += 1
22+
return state
23+
print(get_parking_lot(parking_state))

exercises/16-Techno_beat/app.py

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
def lyrics_generator(list):
2+
beats = ["Boom", "Drop the bass", "!!!Break the bass!!!"]
3+
final_beat = []
4+
break_the_bass = 0
5+
for i in list:
6+
if i == 1:
7+
final_beat.append(beats[1])
8+
break_the_bass += 1
9+
if break_the_bass == 3:
10+
final_beat.append(beats[2])
11+
elif i == 0:
12+
final_beat.append(beats[0])
13+
break_the_bass = 0
14+
return " ".join(final_beat)+" "
115

216

317
# Your code above, nothing to change after this line

0 commit comments

Comments
 (0)