From 225dc7f64c7b566e245d22130599122c3b756099 Mon Sep 17 00:00:00 2001 From: rft0 Date: Sat, 3 Jan 2026 21:41:35 +0300 Subject: [PATCH 1/2] create pyramid_rafet_taskin.py --- Week03/pyramid_rafet_taskin.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Week03/pyramid_rafet_taskin.py diff --git a/Week03/pyramid_rafet_taskin.py b/Week03/pyramid_rafet_taskin.py new file mode 100644 index 00000000..cb8d928a --- /dev/null +++ b/Week03/pyramid_rafet_taskin.py @@ -0,0 +1,7 @@ +def calculate_pyramid_height(blocks): + layer = 0 + while blocks >= (layer + 1): + layer += 1 + blocks -= layer + + return layer From ce1873aedb385c9e931a987fc559599fa5e7260a Mon Sep 17 00:00:00 2001 From: rft0 Date: Sat, 3 Jan 2026 21:46:51 +0300 Subject: [PATCH 2/2] create sequences_rafet_taskin.py --- Week03/sequences_rafet_taskin.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Week03/sequences_rafet_taskin.py diff --git a/Week03/sequences_rafet_taskin.py b/Week03/sequences_rafet_taskin.py new file mode 100644 index 00000000..d20173bd --- /dev/null +++ b/Week03/sequences_rafet_taskin.py @@ -0,0 +1,17 @@ +def remove_duplicates(l): + return list(dict.fromkeys(l)) + +def list_counts(l): + counts = {} + for item in l: + if item in counts: + counts[item] += 1 + else: + counts[item] = 1 + return counts + +def reverse_dict(d): + reversed_d = {} + for key, value in d.items(): + reversed_d[value] = key + return reversed_d