Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def common_argument(M):
- element = M[0][4]
- for i in range(len(M)):
- if M[i][4] != element:
- if period(M, element) < period(M, M[i][4]):
- element = M[i][4]
- return element
- def period(M,c):
- s = 0
- for i in range(len(M)):
- if c in M[i]:
- if M[i][2] != M[i][3]:
- if M[i][2] > M[i][3]:
- s += M[i][2] - M[i][3]
- if M[i][3] > M[i][2]:
- s += M[i][3] - M[i][2]
- return s
- common_argument([[10, 1, 15, 17, 'Vendite'],
- [10, 1, 17, 18, 'Progetti'],
- [16, 2, 10, 12, 'Vendite'],
- [16, 2, 13, 15, 'Progetti'],
- [5,3,10, 13, 'Progetti']])
Add Comment
Please, Sign In to add comment