Skip to content
Open
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
28 changes: 28 additions & 0 deletions Week04/functions_nazmi_emir_ozer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import os

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:
"""
This function returns a mathematical equation

:param x:first number to be exponentiated
:param y:second number to be exponentiated
:param a:power of the first number
:param b:power of the second number
:param c:divisor of the sum of exponentiated
:return:the result of the equation

"""
return (x**a + y**b) / c


caller_dict = {}
call_counter = 0

def fn_w_counter() -> (int, dict[str, int]):
caller = __name__
global call_counter
call_counter += 1
caller_dict[caller] = caller_dict.get(caller, 0) + 1
return call_counter, caller_dict
Loading