Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  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.  
  14. count_lines = 0
  15. total_position = 0
  16. wrong_lines = 0
  17. wrong_lines_list = []
  18.  
  19. for row in position:
  20. try:
  21. count_lines += 1
  22. level = int(row[1]) #в этой переменной сохраните позицию в выдаче
  23. total_position += level #сложите все позиции в этой переменной
  24. except:
  25. wrong_lines += 1
  26. wrong_lines_list.append(row)
  27. print('Количество измерений', count_lines)
  28. print('Некорректные строки', wrong_lines_list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement