A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
2
Task/Function-definition/Python/function-definition-1.py
Normal file
2
Task/Function-definition/Python/function-definition-1.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
def multiply(a, b):
|
||||
return a * b
|
||||
1
Task/Function-definition/Python/function-definition-2.py
Normal file
1
Task/Function-definition/Python/function-definition-2.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
multiply = lambda a, b: a * b
|
||||
8
Task/Function-definition/Python/function-definition-3.py
Normal file
8
Task/Function-definition/Python/function-definition-3.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
class Multiply:
|
||||
def __init__(self):
|
||||
pass
|
||||
def __call__(self, a, b):
|
||||
return a * b
|
||||
|
||||
multiply = Multiply()
|
||||
print multiply(2, 4) # prints 8
|
||||
Loading…
Add table
Add a link
Reference in a new issue