From 168fc6b6c90368e702b28497980a0e0be84aeee1 Mon Sep 17 00:00:00 2001 From: Umut <230315070@ogr.cbu.edu.tr> Date: Wed, 7 Oct 2026 19:24:10 +0300 Subject: [PATCH 1/4] W2HW --- Week02/types_umut_turk.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Week02/types_umut_turk.py diff --git a/Week02/types_umut_turk.py b/Week02/types_umut_turk.py new file mode 100644 index 00000000..c3dbf565 --- /dev/null +++ b/Week02/types_umut_turk.py @@ -0,0 +1,4 @@ +my_int = 1312 +my_float = 1157.25 +my_bool = True +my_complex = 4j+8 \ No newline at end of file From d648e992177636934f4af72677e0957b7d6d01ba Mon Sep 17 00:00:00 2001 From: Umut <230315070@ogr.cbu.edu.tr> Date: Wed, 7 Oct 2026 20:29:48 +0300 Subject: [PATCH 2/4] W3HW --- Week03/pyramid_umut_turk.py | 11 ++++++++++ Week03/sequences.py | 40 +++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 Week03/pyramid_umut_turk.py create mode 100644 Week03/sequences.py diff --git a/Week03/pyramid_umut_turk.py b/Week03/pyramid_umut_turk.py new file mode 100644 index 00000000..69b6f3bc --- /dev/null +++ b/Week03/pyramid_umut_turk.py @@ -0,0 +1,11 @@ +def calculate_pyramid_height(b_num): + a, b = 1, 0 + while b < b_num: + b += a+1 + a += 1 + + + return a-1 + +if __name__ == "__main__": + print(calculate_pyramid_height(15)) \ No newline at end of file diff --git a/Week03/sequences.py b/Week03/sequences.py new file mode 100644 index 00000000..c679adf5 --- /dev/null +++ b/Week03/sequences.py @@ -0,0 +1,40 @@ +def remove_duplicates(a_list): + my_list = a_list[:] + x = 1 + for i in my_list: + for j in my_list[x:]: + if i == j: + my_list.remove(i) + x -=1 + break + x +=1 + + return my_list +def list_counts(a_list): + my_list = a_list[:] + a = remove_duplicates(my_list) + my_dict = dict.fromkeys(a) + for i in a: + x = 0 + for j in a_list: + if i == j: + x += 1 + my_dict[i] = x + + return my_dict +def reverse_dict(a_dict): + my_dict = {} + a_list = list(a_dict) + b_list = list(a_dict.values()) + x = 0 + while x < len(a_list): + print(1) + my_dict[b_list[x]] = a_list[x] + x += 1 + + return my_dict + +if __name__ == "__main__": + print(remove_duplicates([1,5,4,4,4,6,41,54,54,41,6])) + print(list_counts([1,5,5,4,4,4,6,6,6,41,41,41,41,41,54,54,54,54,54,54,54,54,41,6])) + print(reverse_dict(list_counts([1,5,5,4,4,4,6,6,6,41,41,41,41,41,54,54,54,54,54,54,54,54,41,6]))) \ No newline at end of file From 1ec27195af099447faaf77626d69b51d98622d2a Mon Sep 17 00:00:00 2001 From: Umut <230315070@ogr.cbu.edu.tr> Date: Wed, 7 Oct 2026 21:15:06 +0300 Subject: [PATCH 3/4] W3HWV2 --- Week03/sequences.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Week03/sequences.py b/Week03/sequences.py index c679adf5..ea98b898 100644 --- a/Week03/sequences.py +++ b/Week03/sequences.py @@ -1,14 +1,13 @@ def remove_duplicates(a_list): my_list = a_list[:] - x = 1 - for i in my_list: - for j in my_list[x:]: - if i == j: - my_list.remove(i) - x -=1 - break - x +=1 - + for i in a_list: + x = True + for j, k in enumerate(my_list): + if i == k: + if x: + x = False + else: + del my_list[j] return my_list def list_counts(a_list): my_list = a_list[:] @@ -35,6 +34,6 @@ def reverse_dict(a_dict): return my_dict if __name__ == "__main__": - print(remove_duplicates([1,5,4,4,4,6,41,54,54,41,6])) + print(remove_duplicates([1,5,5,4,4,4,6,6,6,41,41,41,41,41,41,54,54,54,54,54,54,54,54,41,6])) print(list_counts([1,5,5,4,4,4,6,6,6,41,41,41,41,41,54,54,54,54,54,54,54,54,41,6])) print(reverse_dict(list_counts([1,5,5,4,4,4,6,6,6,41,41,41,41,41,54,54,54,54,54,54,54,54,41,6]))) \ No newline at end of file From ca2b5fa61c64321a92fda6fad0edd3985f7064c1 Mon Sep 17 00:00:00 2001 From: Umut <230315070@ogr.cbu.edu.tr> Date: Wed, 7 Oct 2026 21:16:40 +0300 Subject: [PATCH 4/4] W3HWV3 --- Week03/{sequences.py => sequences_umut_turk.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Week03/{sequences.py => sequences_umut_turk.py} (100%) diff --git a/Week03/sequences.py b/Week03/sequences_umut_turk.py similarity index 100% rename from Week03/sequences.py rename to Week03/sequences_umut_turk.py