diff --git "a/Week01/info_farukfurkan_\303\247ift\303\247i.py" "b/Week01/info_farukfurkan_\303\247ift\303\247i.py" new file mode 100644 index 00000000..5a9239a2 --- /dev/null +++ "b/Week01/info_farukfurkan_\303\247ift\303\247i.py" @@ -0,0 +1,2 @@ +student_id = "220315036" +full_name = "Faruk Furkan Çiftçi" diff --git a/Week02/types_farukfurkan_ciftci.py b/Week02/types_farukfurkan_ciftci.py new file mode 100644 index 00000000..df495b1c --- /dev/null +++ b/Week02/types_farukfurkan_ciftci.py @@ -0,0 +1,4 @@ +my_int = 22 +my_float = 16.8 +my_bool = True +my_complex = 15c diff --git a/Week03/pyramid_farukfurkan_ciftci.py b/Week03/pyramid_farukfurkan_ciftci.py new file mode 100644 index 00000000..676b3871 --- /dev/null +++ b/Week03/pyramid_farukfurkan_ciftci.py @@ -0,0 +1,10 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + layer = 1 + + while number_of_blocks >= layer: + number_of_blocks -= layer + height += 1 + layer += 1 + + return height diff --git a/Week03/sequenes_farukfurkan_ciftci.py b/Week03/sequenes_farukfurkan_ciftci.py new file mode 100644 index 00000000..f2f0e44f --- /dev/null +++ b/Week03/sequenes_farukfurkan_ciftci.py @@ -0,0 +1,33 @@ +def remove_duplicates(seq: list) -> list: + """ + This function removes duplicates from a list + """ + result = [] + for item in seq: + if item not in result: + result.append(item) + return result + +def list_counts(seq: list) -> dict: + """ + This function counts the number of occurrences of each item in a list. + """ + counts = {} + for item in seq: + if item in counts: + counts[item] += 1 + else: + counts[item] = 1 + return counts + +def reverse_dict(d: dict) -> dict: + """ + This funtion reverses the keys and values of dictionary. + """ + reversed_d = {} + for key, value in d.items(): + + reversed_d[value] = key + return reversed_d + +