I have a list of lists and i am trying to loop through to create a new value in the second list based on two elements with the second list.
for line in input_list[1:]:
i = 0
for element in line:
if i == 13:
if line[7] > line[8]:
line[13] == 1
else:
line[13] == 0
i += 1
I am trying to set the value of line[13] based on the condition that line[7] is greater than line[8].
The code does not flag any errors, so syntactically it is correct, but when i print for the new list, it does not display any values (0 or 1) for line[13].
Any help would be much appreciated.
Thanks,
Ed
==tests for equality, use a single=for assignment.Statement seems to have no effect (pointless-statement).