[Python] Lists in Python returning unexpected

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

  1. Stack

    Stack Membro Participativo

    I am currently studying Lists in Python and came across below. Shouldn't running List1 at the very end return [2,3,'append me!']? Isn't running popped_item=list1.pop() independent of/different from running list1.pop() and then list1

    list1=[2, 3, 'append me!'], popped_item = list1.pop(), popped_item, 'append me!', list1, [2, 3]

    Because, if I run something similar as below. I get 'Sunny Side' and not 'SUNNY SIDE' at the end.

    Name='Sunny Side', Name, 'Sunny Side', YY=Name.upper(), YY, 'SUNNY SIDE', Name, 'Sunny Side'

    Continue reading...

Compartilhe esta Página