It is required to add 0 or 1 to each nested list when the third element matches. The result is:
[[1, 2, [...], None, 0], [4, 23, [...], 4, 0], [2, 3, [...], 50]].
It should look like this:
[[1,2,3, None, 1], [4,23,3,4,1], [2,3,4,5,0]]
s= [[1,2,3, None], [4,23,3,4], [2,3,4,5]] i= 0 for (s [i] ) in s: if (s [i] == 3): s [i]  .append (1) else: s [i]  .append (0) i += 1 print (s)
- Loop in python in one line
- python : Chunks () function with yield, when calling list (chunks ())
- How to combine the same keys in a dictionary? Python
- python : How can I check if one of the elements of one list is in an element of another list?
- List items of lists split across two python lists
- python : Exception TypeError: unhashable type: 'list'
- python : How to create a list in a specific interval?
- python : How to enroll?
- python : How do I change an item in the list?
- python : How do I correctly count the overlapping items in two lists?