[Python] How to append multiple items in one line in Python

Discussão em 'Python' iniciado por Stack, Setembro 13, 2025.

  1. Stack

    Stack Membro Participativo

    count = 0
    i = 0
    while count < len(mylist):
    newlist.append(mylist[i + 1])
    newlist.append(mylist[i + 2])
    # ...
    count = count + 1
    i = i + 12


    I wanted to make the newlist.append() statements into a few statements.

    Continue reading...

Compartilhe esta Página