diff --git a/Week01/info_recepgoktug_avci.py b/Week01/info_recepgoktug_avci.py new file mode 100644 index 00000000..82ce89d0 --- /dev/null +++ b/Week01/info_recepgoktug_avci.py @@ -0,0 +1,2 @@ +student_id = "220316021" +full_name = "Recep Göktuğ Avcı" diff --git a/Week02/types_recepgoktug_avci.py b/Week02/types_recepgoktug_avci.py new file mode 100644 index 00000000..a2d5e485 --- /dev/null +++ b/Week02/types_recepgoktug_avci.py @@ -0,0 +1,4 @@ +my_int = 23 +my_float = 19.07 +my_bool = True +my_complex = 3+4j diff --git a/Week03/pyramid_recepgoktug_avci.py b/Week03/pyramid_recepgoktug_avci.py new file mode 100644 index 00000000..b8e13e5e --- /dev/null +++ b/Week03/pyramid_recepgoktug_avci.py @@ -0,0 +1,11 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + current_layer_blocks = 1 + + while number_of_blocks >= current_layer_blocks: + number_of_blocks -= current_layer_blocks + height += 1 + current_layer_blocks += 1 + + return height + diff --git a/Week03/sequences_recepgoktug_avci.py b/Week03/sequences_recepgoktug_avci.py new file mode 100644 index 00000000..5ce2718d --- /dev/null +++ b/Week03/sequences_recepgoktug_avci.py @@ -0,0 +1,15 @@ +def remove_duplicates(seq: list) -> list: + + return list(set(seq)) + +def list_counts(seq: list) -> dict: + + counts = {} + for item in seq: + + counts[item] = counts.get(item, 0) + 1 + return counts + +def reverse_dict(d: dict) -> dict: + + return {value: key for key, value in d.items()}