-
Notifications
You must be signed in to change notification settings - Fork 2
/
test1.py
89 lines (63 loc) · 1.55 KB
/
test1.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
def pow(a, b):
"""
Calculates the power of a number.
Args:
a (int/float): The base number.
b (int/float): The exponent.
Returns:
int/float: The result of raising the base number to the exponent.
Example:
>>> pow(2, 3)
8
"""
return a**b
def mul(a, b):
"""
Multiplies two numbers.
Args:
a (int/float): The first number.
b (int/float): The second number.
Returns:
int/float: The product of the two numbers.
Example:
>>> mul(2, 3)
6
"""
return a * b
def sub(a, b):
"""
Subtracts two numbers.
Args:
a (int/float): The first number.
b (int/float): The second number.
Returns:
int/float: The difference between the two numbers.
Example:
>>> sub(5, 2)
3
"""
return a - b
def mod(a, b):
"""
Calculates the modulus of two numbers.
Args:
a (int/float): The dividend.
b (int/float): The divisor.
Returns:
int/float: The remainder after dividing the dividend by the divisor.
Example:
>>> mod(5, 2)
1
"""
return a % b
def customFunc(a, b):
"""
Calculates the result of a custom function with two input parameters.
Args:
a (int or float): The first input parameter.
b (int or float): The second input parameter.
Returns:
The result of the custom function, which is calculated as follows:
(a * 3) + (b ** 0.5) + 8
"""
return (a * 3) + (b**0.5) + 8