Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Remove An Item From A Python List With .remove()

** TL;DR

Use [TODO: Code shorthand span ] to remove a value from a Python list.

python
people = ['Jen', 'Greg', 'Jonas']

if 'Greg' in people:
    people.remove('Greg')

print(people)
results start

If you don't check to see if the value is in the list and try to remove one that isn't there it'll throw an error.