Skip to content

Commit 4dd3a02

Browse files
committed
Added pyramid_yasarmert_turkmen.py and sequences_yasarmert_turkmen.py
1 parent 95edce4 commit 4dd3a02

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def calculate_pyramid_height(number_of_blocks):
2+
height = 0
3+
blocks = 0
4+
while blocks + height < number_of_blocks:
5+
height += 1
6+
blocks += height
7+
return height
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
def remove_duplicates(seq: list) -> list:
2+
a_list = []
3+
for i in seq:
4+
if i not in a_list:
5+
a_list.append(i)
6+
return a_list
7+
8+
def list_counts(seq: list) -> dict:
9+
a_dict = {}
10+
for i in seq:
11+
a_dict[i] = seq.count(i)
12+
return a_dict
13+
14+
def reverse_dict(d: dict) -> dict:
15+
a_dict = {}
16+
for key, value in d.items():
17+
a_dict[value] = key
18+
return a_dict

0 commit comments

Comments
 (0)