diff --git a/Week01/info_rukiye_ilhan.py b/Week01/info_rukiye_ilhan.py new file mode 100644 index 00000000..c54f8c59 --- /dev/null +++ b/Week01/info_rukiye_ilhan.py @@ -0,0 +1,2 @@ +student_id="210315038" +full_name="Rukiye İlhan" diff --git a/Week02/types_rukiye_ilhan.py b/Week02/types_rukiye_ilhan.py new file mode 100644 index 00000000..8a25367b --- /dev/null +++ b/Week02/types_rukiye_ilhan.py @@ -0,0 +1,4 @@ +my_int = 7 +my_float = 7.7 +my_bool = False +my_complex = 7j \ No newline at end of file diff --git a/Week03/pyramid_rukiye_ilhan.py b/Week03/pyramid_rukiye_ilhan.py new file mode 100644 index 00000000..97efe0d0 --- /dev/null +++ b/Week03/pyramid_rukiye_ilhan.py @@ -0,0 +1,7 @@ +def calculate_pyramid_height(number_of_blocks): + used_block = 0 + height = 0 + while(number_of_blocks - used_block > height): + height = height + 1 + used_block = (height*(height + 1)//2) + return height diff --git a/Week03/sequences_rukiye_ilhan.py b/Week03/sequences_rukiye_ilhan.py new file mode 100644 index 00000000..5841ba05 --- /dev/null +++ b/Week03/sequences_rukiye_ilhan.py @@ -0,0 +1,20 @@ +def remove_duplicates(seq: list): + for index, number in enumerate(seq): + while seq.count(number) > 1: + seq.remove(number) + + return seq + +def list_counts(seq: list): + dict = {} + for index, number in enumerate(seq): + dict.update({number: seq.count(number)}) + + return dict + +def reverse_dict(d: dict): + new_dict = {} + for key, value in d.items(): + new_dict.update({value:key}) + + return new_dict diff --git a/Week04/decorators_rukiye_ilhan.py b/Week04/decorators_rukiye_ilhan.py new file mode 100644 index 00000000..e69de29b diff --git a/Week04/functions_rukiye_ilhan.py b/Week04/functions_rukiye_ilhan.py new file mode 100644 index 00000000..a3c83032 --- /dev/null +++ b/Week04/functions_rukiye_ilhan.py @@ -0,0 +1,17 @@ +custom_power = lambda x=0, /, e=1: x ** e + + +def custom_equation(x:int=0, y:int=0 , / ,a:int=1,b:int=1,*,c:int=1) -> float: + """ + "The function raises x to the power of a and y to the power of b, then adds the results together and divides the sum by c." + + :param x: Positional-only base value for the first term; defaults to 0. + :param y: Positional-only base value for the second term; defaults to 0. + :param a: Exponent for `x`, can be used as positional or keyword; defaults to 1. + :param b: Exponent for `y`, can be used as positional or keyword; defaults to 1. + :param c: Keyword-only divisor for the result; defaults to 1. + + :return: The result of the equation `(x**a + y**b) / c`. + :rtype: float + """ + return (x**a + y**b) / c