Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Week03/pyramid_recepkadir_altintas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def calculate_pyramid_height(number_of_blocks : int) -> int :
height = 0
block_for_floor = 1
while number_of_blocks >= block_for_floor :
number_of_blocks -= block_for_floor
height += 1
block_for_floor += 1

return height
13 changes: 13 additions & 0 deletions Week03/sequences_recepkadir_altintas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from collections import Counter

def remove_duplicates(seq: list) -> list:

return list(dict.fromkeys(seq))

def list_counts(seq: list) -> dict:

return dict(Counter(seq))

def reverse_dict(d: dict) -> dict:

return {value: key for key, value in d.items()}