Skip to content

Commit 208f3d9

Browse files
authored
Add files via upload
1 parent 4ef8bee commit 208f3d9

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

Week03/pyramid_halilturker_eren.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def calculate_pyramid_height(numOfBlocks):
2+
height = 0
3+
while ((height * (height + 1))/2) <= numOfBlocks:
4+
height+=1
5+
return height - 1

Week03/sequences_halilturker_eren.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
def remove_duplicates(seq: list) -> list:
2+
3+
return list(set(seq))
4+
5+
6+
def list_counts(seq: list) -> dict:
7+
8+
count = {}
9+
10+
for i in seq:
11+
count[i] = seq.count(i)
12+
13+
return count
14+
15+
16+
17+
def reverse_dict(d: dict) -> dict:
18+
19+
reversed = {}
20+
21+
for key, value in d.items():
22+
reversed[value] = key
23+
24+
return reversed

0 commit comments

Comments
 (0)