HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

Python - Adding & Removing Items from Lists Tutorial

29,603 views January 29, 2020 4:53

Watch on YouTube
ChannelGeek Tutorials

Description from the creator

Learn how to add and remove items from a list in Python.

⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I've been using Kite for 6 months and I love it! kite.com/get-kite/?utm_medium=referral&utm_…

~ CODE ~

# ADDING ITEMS TO LIST
shopping_list = ["apples", "bananas", "carrots", "potatoes"]

item = input("What item would you like to add to the shopping list: ")
shopping_list.append(item)

print(shopping_list)



# REMOVING ITEMS FROM LIST
shopping_list = ["apples", "bananas", "carrots", "potatoes"]

item = input("What item would you like to remove from the shopping list: ")
shopping_list.remove(item)

print(shopping_list)

About this tutorial

Geek Tutorials published this 4:53 video tutorial on January 29, 2020. It has been watched 29,603 times on YouTube.

Category
Education
Duration
4:53
Published
January 29, 2020
Views
29,603
Likes
250

Tags

Share

This tutorial in other languages