Tuesday, October 4, 2016

[ More Types ] List Slices

List Slices => involves indexing with "two colon -separated integers" => this returns a new list containing all the values in the old list between the indices. ~ similar to range

first number in the slice is omitted , start of the list , second number .... end
slice can also be done on tuples.

can also have third number => representing the step

negative values can be used in list slicing  , count form end. =>reverse list !!

No comments:

Post a Comment