Python Tutorial: Slicing Lists and Strings

Share this & earn $10
Corey Schafer
Published at : 15 Sep 2021
263057 views
4982
30

In this video we will look at how to slice lists and strings in Python. Slicing allows us to extract certain elements from these lists and strings. This can be extremely useful for stripping out certain values from lists or getting a substring of a characters from a string. Let’s take a look at a few code examples.

The code from this video can be found at:
https://github.com/CoreyMSchafer/code_snippets/tree/master/Slicing


✅ Support My Channel Through Patreon:
https://www.patreon.com/coreyms

✅ Become a Channel Member:
https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g/join

✅ One-Time Contribution Through PayPal:
https://goo.gl/649HFY

✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey’s Public Amazon Wishlist
http://a.co/inIyro1

✅ Equipment I Use and Books I Recommend:
https://www.amazon.com/shop/coreyschafer

▶️ You Can Find Me On:
My Website - http://coreyms.com/
My Second Channel - https://www.youtube.com/c/coreymschafer
Facebook - https://www.facebook.com/CoreyMSchafer
Twitter - https://twitter.com/CoreyMSchafer
Instagram - https://www.instagram.com/coreymschafer/

#Python

Python (Programming Language)Array SlicingList

Ariana Grande - get well soon (Audio)

Ariana Grande - get well soon (Audio)

as it is, or even, perhaps a recitation and emigration excerpt

as it is, or even, perhaps a recitation and emigration excerpt

FNAF VR Help Wanted ENNARD SONG "Every Body" by Rockit Gaming

FNAF VR Help Wanted ENNARD SONG "Every Body" by Rockit Gaming

Repair DAMAGED Hydraulic Cylinder Barrels | Hitachi Zaxis 670 Excavator Part 2

Repair DAMAGED Hydraulic Cylinder Barrels | Hitachi Zaxis 670 Excavator Part 2

10 CRYPTO COINS LIKELY TO 10X BY DECEMBER! (PERFECT TIMING)

10 CRYPTO COINS LIKELY TO 10X BY DECEMBER! (PERFECT TIMING)

Alan Fitzpatrick - A Call Out For Love (ft. LOWES)

Alan Fitzpatrick - A Call Out For Love (ft. LOWES)

BUBBLEGUM | How It's Made

BUBBLEGUM | How It's Made

Watch Omega TV for latest news from Cyprus in Greek

Watch Omega TV for latest news from Cyprus in Greek

#brickwork #selfbuild in a big country (Digitally Remastered) Big country 

#brickwork #selfbuild in a big country (Digitally Remastered) Big country 

AN EASY GIRL trailer | BFI London Film Festival 2019

AN EASY GIRL trailer | BFI London Film Festival 2019

HOT DEMON B!TCHES NEAR U ! ! !

HOT DEMON B!TCHES NEAR U ! ! !

Music You Should Listen To At Least Once In Your Lifetime | "THE ANCIENT TRAIL" by Tiago D. Ferreira

Music You Should Listen To At Least Once In Your Lifetime | "THE ANCIENT TRAIL" by Tiago D. Ferreira

What's New in Pinnacle Studio 25?

What's New in Pinnacle Studio 25?

How To Identify Points Of Interest "Expert Entries" | Forex Trading

How To Identify Points Of Interest "Expert Entries" | Forex Trading

Surviving Off ONLY Dollar Tree for 24 HOURS

Surviving Off ONLY Dollar Tree for 24 HOURS

Ludacris - What's Your Fantasy (Official Music Video) ft. Shawnna

Ludacris - What's Your Fantasy (Official Music Video) ft. Shawnna

Vacationer - Paradise Waiting

Vacationer - Paradise Waiting

İngilizce’de during ve while kelimelerinin farkları

İngilizce’de during ve while kelimelerinin farkları

Ross From Friends - 'Spatter/Splatter'

Ross From Friends - 'Spatter/Splatter'

What caused the French Revolution? - Tom Mullaney

What caused the French Revolution? - Tom Mullaney

Jannie and Emma Wants to Be The Best Sister for Ellie | How to Be Good Sisters

Jannie and Emma Wants to Be The Best Sister for Ellie | How to Be Good Sisters

Training Exact Online 15 april 2021 | KroeseWevers

Training Exact Online 15 april 2021 | KroeseWevers

Cushty

Cushty

TROLLING A FAST FOOD WORKER ON DISCORD! (He Was Fired)

TROLLING A FAST FOOD WORKER ON DISCORD! (He Was Fired)

The Future of Facilities Management

The Future of Facilities Management

New Nightcore Song - Too Much Noise by Astrid Starlight (Lyric Video)

New Nightcore Song - Too Much Noise by Astrid Starlight (Lyric Video)

Into The Flow - Boys Brigade

Into The Flow - Boys Brigade

Shaneil Muir - Exclusive (Official Music Video)

Shaneil Muir - Exclusive (Official Music Video)

MC Kresha - Era (Official Video)

MC Kresha - Era (Official Video)

Newsletter Strategy

Newsletter Strategy

Pearl jam - Come Back (Studio version)

Pearl jam - Come Back (Studio version)

Eric Ludy - He is (The Names of God) – (Return of Majesty Trilogy)

Eric Ludy - He is (The Names of God) – (Return of Majesty Trilogy)

Tom Grennan - Little Bit of Love (Official Video)

Tom Grennan - Little Bit of Love (Official Video)

2 Chainz Tries $1000 ‘Luxury' Ice Cubes | MOST EXPENSIVEST

2 Chainz Tries $1000 ‘Luxury' Ice Cubes | MOST EXPENSIVEST

Passion

Passion

DONBOR - Against The Law

DONBOR - Against The Law

Zener Diode Regulation - Varying load resistance, Varying input voltage and Varying input resistance

Zener Diode Regulation - Varying load resistance, Varying input voltage and Varying input resistance

Marrakesh - To Comprehend (Official Video)

Marrakesh - To Comprehend (Official Video)

Chillier temperatures for Veterans day, pattern shifts for the weekend into next week

Chillier temperatures for Veterans day, pattern shifts for the weekend into next week

Christ is Sufficient - Madison Pritt, Lincoln Pritt, Clayton Rash, Caroline Rash

Christ is Sufficient - Madison Pritt, Lincoln Pritt, Clayton Rash, Caroline Rash

Stavroz - The Finishing (Original Mix)

Stavroz - The Finishing (Original Mix)

Elevating My Creativity With The Xperia 1 III: Colby Brown in Alaska

Elevating My Creativity With The Xperia 1 III: Colby Brown in Alaska

மொறுமொறு செட்டிநாடு சோமாஸ்  | Diwali Special Sweet | sweet somas Recipe | somas  in tamil

மொறுமொறு செட்டிநாடு சோமாஸ் | Diwali Special Sweet | sweet somas Recipe | somas in tamil

Development of New Gizmos Bring Forth Emerging Technology

Development of New Gizmos Bring Forth Emerging Technology

Twilight Saga Breaking Dawn Part2 || Jacob imprints On Renesmee

Twilight Saga Breaking Dawn Part2 || Jacob imprints On Renesmee

TOTAL KNOCK OUT: Allen West SHUTS DOWN obnoxious smug SJW

TOTAL KNOCK OUT: Allen West SHUTS DOWN obnoxious smug SJW

6 Habits To Improve Yourself

6 Habits To Improve Yourself

A Sarcasm Introduction

A Sarcasm Introduction

Nikki Williams - Glowing

Nikki Williams - Glowing