Mar-25-2021, 04:51 AM
list index out of range
means you've used an index that is beyond the end of the list.In your case you refer to
nav[2]
in that expression. If nav
does not have three elements in it when that expression is evaluated, you'll get that error.nav starts off empty and you only add one element to it when you reach line 28, so this should fail every time, unless
dados_voo
is empty. If that's empty, then you don't enter the loop and have a chance to make nav
longer.