Learning Python: Removing from a list - Deepstash
Learning Python: Removing from a list

Learning Python: Removing from a list

In todays image we can see that i am using two new keywords, remove and pop.

The best way to think about it is that pop "pop()" removes the last element from the list, or you could put a index value, so in this case in the image i have put 1, this is the second element because python starts with 0. Next we have remove and this wants to know the value you want to remove, so in this case i entered a string, and it removed it from the list.

If you was to put "name = user.remove("sam")" it would take out the value from the list and put into the variable to be used later. 

1

9 reads

CURATED FROM

IDEAS CURATED BY

samuelbancroft

Keep reading, keep studying, the more you learn the more you change. If you are doing the Python lessons please join this discord channel https://discord.gg/kugXx9KY but please follow the rules

learning is the best this we can do to better our selves, teach each other

Similar ideas to Learning Python: Removing from a list

Learning Python: More on printing and variables

Learning Python: More on printing and variables

In this part we will be going over more on variables and printing them.

So let's make a variable and give it the value of 10, so it should look something like this X = 10, X could be any word really just not a reserved word, here is a link to a website with alot of reserved words that can't...

Learning Python: Basic Mathematical Operators error

Learning Python: Basic Mathematical Operators error

So as you can see from the image we are using 2 variables, x and y. Like in the previous lessons explained about variables, x contains the string Hello World, what makes it a string is " " the use of these quotation marks. Next in y there is a integer value 10. Then i am adding them both together...

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Personalized microlearning

100+ Learning Journeys

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates