From 4e08e0c1d2caa467349dbc52b6206c585b065061 Mon Sep 17 00:00:00 2001 From: protagonist9 Date: Wed, 22 Oct 2025 02:39:02 +0300 Subject: [PATCH 1/3] Created pyramid_first_last.py --- Week03/pyramid_first_last.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Week03/pyramid_first_last.py diff --git a/Week03/pyramid_first_last.py b/Week03/pyramid_first_last.py new file mode 100644 index 00000000..fa762647 --- /dev/null +++ b/Week03/pyramid_first_last.py @@ -0,0 +1,7 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + while(number_of_blocks >= 0): + height += 1 + number_of_blocks -= height + return height - 1 + From 043bf57b098602f279d0cedd12bc1267a65a3703 Mon Sep 17 00:00:00 2001 From: protagonist9 Date: Mon, 27 Oct 2025 18:48:32 +0300 Subject: [PATCH 2/3] Created pyramid_tarik_bozgan.py --- Week03/{pyramid_first_last.py => pyramid_tarik_bozgan.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Week03/{pyramid_first_last.py => pyramid_tarik_bozgan.py} (100%) diff --git a/Week03/pyramid_first_last.py b/Week03/pyramid_tarik_bozgan.py similarity index 100% rename from Week03/pyramid_first_last.py rename to Week03/pyramid_tarik_bozgan.py From 26928502bc7a962089b747ff423e52069c00fca3 Mon Sep 17 00:00:00 2001 From: protagonist9 Date: Sat, 6 Dec 2025 20:14:45 +0300 Subject: [PATCH 3/3] Week03 homeworks --- Week03/sequences_tarik_bozgan.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Week03/sequences_tarik_bozgan.py diff --git a/Week03/sequences_tarik_bozgan.py b/Week03/sequences_tarik_bozgan.py new file mode 100644 index 00000000..1ba02067 --- /dev/null +++ b/Week03/sequences_tarik_bozgan.py @@ -0,0 +1,23 @@ +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 in counts: + counts[item] += 1 + else: + counts[item] = 1 + return counts + + +def reverse_dict(d): + reversed_dict = {} + for key, value in d.items(): + reversed_dict[value] = key + return reversed_dict \ No newline at end of file