View difference between Paste ID: ENMcpdrg and Twx1rBeG
SHOW: | | - or go back to the newest paste.
1
position = [
2
['2019-05-01', '- 6'],
3
['2019-05-02', '+5'],
4
['2019-05-03', ' 5'],
5
['2019-05-04', '4'],
6
['2019-05-05', '5'],
7
['2019-05-06', '5'],
8
['2019-05-07', '4'],
9
['2019-05-08', 'Error 5'],
10
['2019-05-09', '3'],
11
['2019-05-10', '3'],
12
]
13
count_lines = 0
14
total_position = 0
15
wrong_lines = 0 
16-
wrong_lines = 0
16+
17
for row in position:
18-
try:
18+
    try:
19-
    for row in position:
19+
20
        level = int(row[1]) #в этой переменной сохраните позицию в выдаче 
21-
        level = int(row[1])
21+
        total_position += level  #сложите все позиции в этой переменной
22-
        total_position += level
22+
    
23
    except:
24
        wrong_lines != count_lines
25
print(total_position / count_lines)
26-
        
26+
27
print('Количество некорректных строк', wrong_lines)