Python Slice Notation Tutorial - How to Slice Strings and Lists Explained with Examples (+ Reverse)

preview_player
Показать описание
Tutorial on Python slicing syntax and slice notation. We learn how to slice strings, slice lists, reverse strings, reverse lists, and much more.

There's also way more python programming tutorials for you.

📖 You can check out the Udemy course (Python Built-in Functions) here:

⚙️ Recommended Computer Gear:

✈️ Recommended Digital Nomad Gear:
Рекомендации по теме
Комментарии
Автор

I want more videos on python...it should be on basic and building software, AI's!!!!

sadmansakib
Автор

hey man, really great video, thank you.
I had one single question, when you typed p[0:-3], why does it print the "first" 3 letters and not the "last" 3 letters since it is negative? I would assume that it would start at position 0 (which is P), and then go backwards to the "N", and "O" at the end.

hamzaalaudi
Автор

a = [1, 2, 3, 4, 5]
print(a[len(a)])
result : crash
why? can you explain please ?

brunohuynh
Автор

P[ : : -1], Why is it going backwards?

suni