What is the real-world application of List Slices? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the real-world application of List Slices?

I have no idea where/when need to use this

17th Jan 2017, 10:07 AM
Bryan Angelo
Bryan Angelo - avatar
2 Answers
+ 1
I use them a lot, especially extracting data from document or dataset. For example: I have a web log file and need only web page to extract, all extra info like date, time, user and etc. are omited.
18th Jan 2017, 7:17 PM
Linas Fx
Linas Fx - avatar
- 1
Hopefully you would learn to use numpy package for real math applications but slicing is taking a data set in chunks and moving it around. This is more efficient than just looping through and thus adding to your time complexity. In case you dont know what I mean, take this example. Slicing is like taking a pack of cookies and putting them in your lunch box, the alternative to slicing is taking each individual cookie and putting them in your lunch box(looping through indicies). Both menthods have the same end result but one takes more time.
28th Jan 2017, 2:49 PM
Michael Timbes
Michael Timbes - avatar