[Python] How to delete the short lists from a long nested list even the items are not...

Discussão em 'Python' iniciado por Stack, Junho 15, 2025.

  1. Stack

    Stack Membro Participativo

    For example:

    t=[[1, 2, 3, 4, 5, 6], [2, 3, 4, 5, 6], [2, 3, 4, 5, 6], [3, 5], [4, 5, 6],[4,5,6],[6,7], [6], [1]]


    I want to delete the short lists if the items are included in a long one, even the items are not continuous. So, I expect the result to be:

    [[1, 2, 3, 4, 5, 6],[6,7]]


    What can I try next?

    Continue reading...

Compartilhe esta Página