Python List Methods Get Things Done

Python List Methods Get Things Done

Life is full of amazing opportunities. You can explore forests, climb mountains, run with wolves. Or you could learn Python. What do you do when you’re overwhelmed with choices? Creating a Python list and using Python list methods will help you prioritize your goals and achieve success.

Getting Things Done with Python List Methods

I wrote a to-do list.

  • Things to do today
    • Go to the store
    • Play
    • Sing a tune or song
    • Eat
    • Draw
    • Drink
    • Get dizzy
    • Sit down

Lists are so useful. I have so much to do today! Let’s put my to-do list in a Python list:

What’s on your to-do list?

append()

If I want to add an item to my list, I use the append() method, like this:

extend()

If I didn’t finish my to-do list from yesterday, I can add it to today’s list:

remove()

When it’s time to get realistic about our goals, we can remove items using the remove() method.

pop()

When a list item needs extra attention, make it pop! The pop() method removes and returns an item by index.

The pop() method is useful when you want to remove an item from a list and perform another action on it, like moving it to a different list.

If ‘Learn Python’ is still on your list, see you in the next chapter introducing Python functions.

Python List Methods Get Things Done was posted by on . Jared likes to make things. He really wants you to watch The Hello World Program so you can learn the skills you need to build an awesome future. His contributions to the show include puppetry, 3D animation, doodling and speaking in a bad British accent. And yes, that is a fox sitting on his face.

Discuss this article in the Comments below, or and it with your friends. Learn more about Python by subscribing to The Hello World Newsletter .

Join the Discussion

Subscribe to our Mailing List

Stay up to date on the latest videos and tutorials with our monthly newsletter

The email entered is invalid
×