Python 3.7: Pop() List Method In Python

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Was struggling to wrap my head around this with the overly complex explanations out there but this really just put it into perspective, super helpful thanks so much!

jassytech
Автор

Awesome thank you.

I'm currently reading this book: Python crash course a hands on eric matthes and I'm at the point where it's talking about the pop function.

I wasn't sure at the time, but now it seems like I understand the situation through this tutorial.

Thank you. :-)

SnugLife
Автор

Thank you very much! Simple and straight to the point.

karimabdelaziz
Автор

straight to the point, just like it should be. Thank you!

eliegedeonbikieyoudonangou
Автор

Thanks! It pops the object out of the list and into my hand. This really helped!

thegovernmentusa
Автор

you can also store popped items from a list in a variable so you could access it later on. its a pretty useful method.

yearsago-ffts
Автор

As far as my understanding goes when it comes to the pop method, it removes elements by passing through the index of the element (correct me if I'm wrong, I'm still learning). I think it just confuses when you have integers in your list when you're demonstrating how the method works. I think it would be more clear if you had strings in your list for example.

truetrueman
Автор

Thank you! can I pop an i item in a loop?

spongelena
Автор

When i am using pop it sats pop takes on argument what is the solution gor this

monikabindlish
Автор

How do you preserve the order of the remaining elements? Index position (2) was taken out with .pop(2) but is there a way that auto-corrects the order to avoid index errors, because the new list looks as though int(3) is in index position 2 now.

ryanwalker