filmov
tv
Python: Converting Strings to Lists
![preview_player](https://i.ytimg.com/vi/BasHt0ki19Y/maxresdefault.jpg)
Показать описание
In this video we'll introduce the concepts of indexing, slicing, and immutability, then we'll examine how they affect our code. Indexing and slicing are incredibly useful tools for delivering pieces of your data.
A note on the interpreter: you don't have to use print() to see the contents of a variable here, which is one of the reasons the interpreter is great for testing small things like this. I don't think I mentioned that on camera and wanted to prevent any confusion surrounding my frequent use of the word print.
A note on immutability: throughout this section I say 'redefine a string through concatenation.' This is not accurate, you redefine the variable using concatenated strings, but you are creating a new string, not editing the original.
Github:
Timecodes:
0:00 - Cat
0:20 - Indexing
2:40 - Slicing
5:40 - Copy with Slice
6:50 - Slice with Steps
7:30 - Immutability
9:20 - Lists
11:00 - List Formatting
14:00 - " ".join()
16:10 - Wrap up
17:35 - Bonus method demo
21:45 - Cat
A note on the interpreter: you don't have to use print() to see the contents of a variable here, which is one of the reasons the interpreter is great for testing small things like this. I don't think I mentioned that on camera and wanted to prevent any confusion surrounding my frequent use of the word print.
A note on immutability: throughout this section I say 'redefine a string through concatenation.' This is not accurate, you redefine the variable using concatenated strings, but you are creating a new string, not editing the original.
Github:
Timecodes:
0:00 - Cat
0:20 - Indexing
2:40 - Slicing
5:40 - Copy with Slice
6:50 - Slice with Steps
7:30 - Immutability
9:20 - Lists
11:00 - List Formatting
14:00 - " ".join()
16:10 - Wrap up
17:35 - Bonus method demo
21:45 - Cat