forked from se-nitech/diff-patch-git
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
39 lines (27 loc) · 671 Bytes
/
Copy pathmain.py
File metadata and controls
39 lines (27 loc) · 671 Bytes
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
# today's new version
def calculate_weights(x, y):
z = 2 * x - y * 0.99
return z
## equation modified
# def calculate_weights(x, y):
# z = 2 * x - y
# return z
## # a simple mistake ...
## def calculate_weights(x, y):
## z = 2 * x - y + 1
## return z
## # # new version
## # def calculate_weights(x, y):
## # z = 2 * x - z + 1
## # return z
#### def calculate_weights(x, y):
#### z = 2 * x - y
#### return z
def apply_to_adjacent_pairs(a):
for i in range(len(a) - 1):
calculate_weights(a[i], a[i + 1])
def main():
a = [1, 2, 3, 4, 5]
apply_to_adjacent_pairs(a)
if __name__ == '__main__':
main()