Skip to content

Commit fd26d09

Browse files
authored
Create Calculating With Functions - 5 kyu.py
1 parent 3b5d8cb commit fd26d09

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def zero(func=None): return 0 if func is None else func(0)
2+
def one(func=None): return 1 if func is None else func(1)
3+
def two(func=None): return 2 if func is None else func(2)
4+
def three(func=None): return 3 if func is None else func(3)
5+
def four(func=None): return 4 if func is None else func(4)
6+
def five(func=None): return 5 if func is None else func(5)
7+
def six(func=None): return 6 if func is None else func(6)
8+
def seven(func=None): return 7 if func is None else func(7)
9+
def eight(func=None): return 8 if func is None else func(8)
10+
def nine(func=None): return 9 if func is None else func(9)
11+
12+
def plus(y): return lambda x: x + y
13+
def minus(y): return lambda x: x - y
14+
def times(y): return lambda x: x * y
15+
def divided_by(y): return lambda x: x // y

0 commit comments

Comments
 (0)