From 2a6da2b57c1d81c13b230f1a18ff5e5f6e7d62a5 Mon Sep 17 00:00:00 2001 From: cemil koca Date: Sat, 7 Mar 2026 12:22:58 +0300 Subject: [PATCH 1/2] Add files via upload --- Week03/pyramid_cemil_koca.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Week03/pyramid_cemil_koca.py diff --git a/Week03/pyramid_cemil_koca.py b/Week03/pyramid_cemil_koca.py new file mode 100644 index 00000000..682ec92e --- /dev/null +++ b/Week03/pyramid_cemil_koca.py @@ -0,0 +1,9 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + remaining = number_of_blocks + + while remaining >= height + 1: + height += 1 + remaining -= height + + return height \ No newline at end of file From 0f9e19e5f9bc25d64b00db340c25709c99b71cf3 Mon Sep 17 00:00:00 2001 From: cemil koca Date: Sat, 7 Mar 2026 12:27:11 +0300 Subject: [PATCH 2/2] Add files via upload --- Week03/sequences_cemil_koca.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Week03/sequences_cemil_koca.py diff --git a/Week03/sequences_cemil_koca.py b/Week03/sequences_cemil_koca.py new file mode 100644 index 00000000..187169bf --- /dev/null +++ b/Week03/sequences_cemil_koca.py @@ -0,0 +1,22 @@ +def remove_duplicates(seq): + result = [] + for item in seq: + if item not in result: + result.append(item) + return result + + +def list_counts(seq): + counts = {} + for item in seq: + if item not in counts: + counts[item] = 0 + counts[item] += 1 + return counts + + +def reverse_dict(d): + result = {} + for key in d: + result[d[key]] = key + return result \ No newline at end of file