Python Tutorial: Slicing Lists and Strings

Share this & earn $10
Corey Schafer
Published at : 03 Oct 2021
267269 views
5059
31

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

Leap (Leap)

Leap (Leap)

Topic, A7S - Breaking Me ft. A7S

Topic, A7S - Breaking Me ft. A7S

Fundamental Analysis

Fundamental Analysis

Easy to Construct a Beautiful Waterfall Aquarium

Easy to Construct a Beautiful Waterfall Aquarium

EVERYDAY MAKEUP LOOK TO ACCENTUATE THE EYES  | ALI ANDREEA

EVERYDAY MAKEUP LOOK TO ACCENTUATE THE EYES | ALI ANDREEA

Monetary and fiscal policy | Aggregate demand and aggregate supply | Macroeconomics | Khan Academy

Monetary and fiscal policy | Aggregate demand and aggregate supply | Macroeconomics | Khan Academy

2021 Owambe/Asoebi Style Collections ||  Fashionable And Alluring Asoebi Styles For Classy Ladies

2021 Owambe/Asoebi Style Collections || Fashionable And Alluring Asoebi Styles For Classy Ladies

UNUSUAL MEMES COMPILATION V154

UNUSUAL MEMES COMPILATION V154

The Simple But Crucial Upgrades EVERY Tele Owner Should Do!! || NOSTALgufish

The Simple But Crucial Upgrades EVERY Tele Owner Should Do!! || NOSTALgufish

Hurra for gratis byggematerialer

Hurra for gratis byggematerialer

Fast Beauty Hacks You'll Definitely Will Adore

Fast Beauty Hacks You'll Definitely Will Adore

10 PC Graphics Settings You NEED TO TURN OFF NOW

10 PC Graphics Settings You NEED TO TURN OFF NOW

THIS SQUAD LOCKDOWN APARTENENT WITH ICE WALLS | 😂CHINESE CAMPERS IN BGMI | FAROFF PUBG MOBILE

THIS SQUAD LOCKDOWN APARTENENT WITH ICE WALLS | 😂CHINESE CAMPERS IN BGMI | FAROFF PUBG MOBILE

PISCES ❤️ A CRAZY ACTION FROM A VERY PARTICULAR PERSON ❤️ Weekly Love Reading 1 - 7th November 2021

PISCES ❤️ A CRAZY ACTION FROM A VERY PARTICULAR PERSON ❤️ Weekly Love Reading 1 - 7th November 2021

One Direction - What Makes You Beautiful (Official Video)

One Direction - What Makes You Beautiful (Official Video)

GET ALL PRIME WARFRAMES, WEAPONS & ACCESSORIES IN ONE EVENT [2021]

GET ALL PRIME WARFRAMES, WEAPONS & ACCESSORIES IN ONE EVENT [2021]

Mary, Mary, Quite Contrary - THE BEST Educational Songs for Children | LooLoo Kids

Mary, Mary, Quite Contrary - THE BEST Educational Songs for Children | LooLoo Kids

Gunna - Top Off [Official Audio]

Gunna - Top Off [Official Audio]

🔥TURN $3K INTO $300K WITH THESE METAVERSE COINS (VERY URGENT!!) 🚀

🔥TURN $3K INTO $300K WITH THESE METAVERSE COINS (VERY URGENT!!) 🚀

The Secular State and Religious Tolerance

The Secular State and Religious Tolerance

Alex Hill - You Will See (Chunkee Remix)

Alex Hill - You Will See (Chunkee Remix)

10 Assassination Attempts That Were Shown On Television

10 Assassination Attempts That Were Shown On Television

HBO's Looking - Patrick & Kevin meeting for the first time [Team Kevin]

HBO's Looking - Patrick & Kevin meeting for the first time [Team Kevin]

Top 15 Best Global Brands Ranking (2000-2018)

Top 15 Best Global Brands Ranking (2000-2018)

🔴*NEW* BERMUDA MAX RUSH HOUR🔥

🔴*NEW* BERMUDA MAX RUSH HOUR🔥

How To Make Money Using Classified Ads

How To Make Money Using Classified Ads

BLOCK '93 - SEND US LOCATION

BLOCK '93 - SEND US LOCATION

INSERTING A FOLEY CATHETER ON A FEMALE PATIENT/SKILL DEMO

INSERTING A FOLEY CATHETER ON A FEMALE PATIENT/SKILL DEMO

Rae Sremmurd - This Could Be Us (Lyrics) She gotta say please

Rae Sremmurd - This Could Be Us (Lyrics) She gotta say please

Julius Dreisig & Zeus X Crona - Invisible [NCS Release]

Julius Dreisig & Zeus X Crona - Invisible [NCS Release]

JobKeeper was $6.2 billion 'sugar hit' for larger businesses | The Business | ABC News

JobKeeper was $6.2 billion 'sugar hit' for larger businesses | The Business | ABC News

Occurrence - My Eternal Autumn (Official Music Video)

Occurrence - My Eternal Autumn (Official Music Video)

Adults get Climax of Pleasure At Tokyo's Hidden Alleys Of Kabukicho

Adults get Climax of Pleasure At Tokyo's Hidden Alleys Of Kabukicho

Demis Roussos - Forever and Ever

Demis Roussos - Forever and Ever

The Most Efficient Internal Combustion Engine - HCCI

The Most Efficient Internal Combustion Engine - HCCI

ΤΟΥΣ ΣΚΟΤΩΣΑ?! (Until Dawn #3)

ΤΟΥΣ ΣΚΟΤΩΣΑ?! (Until Dawn #3)

You should see this excellent process  Amazing CNC working machine

You should see this excellent process Amazing CNC working machine

Bebe Rexha - Meant to Be (feat. Florida Georgia Line) [Official Music Video]

Bebe Rexha - Meant to Be (feat. Florida Georgia Line) [Official Music Video]

Friedrich Nietzsche - How To Achieve Self Mastery (Existentialism)

Friedrich Nietzsche - How To Achieve Self Mastery (Existentialism)

Cloonee - Separated

Cloonee - Separated

XXXTENTACION - Going Down! (Lyrics)

XXXTENTACION - Going Down! (Lyrics)

The Beatles - Help!

The Beatles - Help!

Don'T Worry Be Happy

Don'T Worry Be Happy

100 Layers of Chocolate Food Challenge | Sweet War for 24 Hours! Chocolate VS Real Food by RATATA

100 Layers of Chocolate Food Challenge | Sweet War for 24 Hours! Chocolate VS Real Food by RATATA

Martha Munizzi's "Excellent"

Martha Munizzi's "Excellent"

In The Meanwhile

In The Meanwhile

Little Shop of Horrors It's Suppertime

Little Shop of Horrors It's Suppertime

Sean Paul - Temperature (Official Video)

Sean Paul - Temperature (Official Video)

Abraham Hicks~ Just bask in the idea~It's under construction.~ AD FREE

Abraham Hicks~ Just bask in the idea~It's under construction.~ AD FREE