-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path008functions.py
44 lines (34 loc) · 1.04 KB
/
008functions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#py3.7
def strFromOperation(operation,a, b):
return f'{operation} {a} and {b} result'
def add(a, b):
return a + b
def chooseBiggerOrZero(a, b):
if a > b:
return a
elif a < b:
return b
else:
return 0
def logOperarion(operation, a, b):
print(strFromOperation(operation.__name__, a, b))
return operation(a, b)
print(logOperarion(add, 7,8))
print(logOperarion(chooseBiggerOrZero, 7,8))
print(chooseBiggerOrZero(1, 2))
print(chooseBiggerOrZero(4, 5))
print(chooseBiggerOrZero(4, 4))
def Плюс(переменнаяА, переменнаяБ): #https://stackoverflow.com/questions/17043894/what-unicode-symbols-are-accepted-in-python3-variable-names
return переменнаяА + переменнаяБ
print(logOperarion(Плюс, 7,8))
def noReturn():
print('no return - return:')
print(noReturn())
#assert noReturn() == None
def explicitNone():
print('explicit none:')
return None
print(explicitNone())
def doNothing():
pass
print(doNothing())