Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Week01/info_rukiye_ilhan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
student_id="210315038"
full_name="Rukiye İlhan"
4 changes: 4 additions & 0 deletions Week02/types_rukiye_ilhan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
my_int = 7
my_float = 7.7
my_bool = False
my_complex = 7j
7 changes: 7 additions & 0 deletions Week03/pyramid_rukiye_ilhan.py
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions Week03/sequences_rukiye_ilhan.py
Original file line number Diff line number Diff line change
@@ -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
Empty file.
17 changes: 17 additions & 0 deletions Week04/functions_rukiye_ilhan.py
Original file line number Diff line number Diff line change
@@ -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