Skip to content

Commit 14b06f6

Browse files
committed
first exp of decorastors
1 parent 2c9590c commit 14b06f6

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

decorator.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
def my_decorators(func):
1+
def cheaker(func):
22
def wrapper(x, y):
33
if y == 0:
4-
return print(("what the fuck zero error"))
4+
return print("error zeroo division :(((")
55
else:
6-
return func(x,y)
7-
6+
return func(x, y)
87
return wrapper
9-
@my_decorators
10-
def divide(x,y):
8+
@cheaker
9+
def divider(x , y):
1110
print(x/y)
1211

13-
divide(1,)
14-
12+
divider(2,0)

0 commit comments

Comments
 (0)