Untitled

From Buff Earthworm, 2 Months ago, written in Plain Text, viewed 87 times.
URL http://codebin.org/view/014bc080 Embed
Download Paste or View Raw
  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.  
  15. count_lines = 0
  16. wrong_lines_content = []
  17.  
  18. for row in position:
  19.     try:
  20.         count_lines += 1
  21.         level = int(row[1])
  22.        
  23.     except:
  24. #в этой строке выдает ошибку: 'NoneType' object has no attribute 'append'
  25.         wrong_lines_content = wrong_lines_content.append(row)
  26.  
  27. print (f'Количество измерений {count_lines}')
  28. print (f'Некорректные строки {wrong_lines_content}')

Reply to "Untitled"

Here you can reply to the paste above