Skip to content

Commit 8863bda

Browse files
committed
week3 tasks added
1 parent 5b21d73 commit 8863bda

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Week03/pyramid_ahmet_tayyip_mujde.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def calculate_pyramid_height(blocks):
2+
height = 0
3+
required_blocks = 1
4+
5+
while blocks >= required_blocks:
6+
blocks -= required_blocks
7+
height += 1
8+
required_blocks += 1
9+
10+
return height
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def remove_duplicates(seq:list) -> list:
2+
return list(set(seq))
3+
4+
5+
def list_counts(seq: list) -> dict:
6+
counts = {}
7+
for item in seq:
8+
counts[item] = counts.get(item, 0) + 1
9+
return counts
10+
11+
12+
def reverse_dict(d: dict) -> dict:
13+
return {v: k for k, v in d.items()}

0 commit comments

Comments
 (0)