Chapter 7 - Indexing and Slicing of Sequences Flashcards
1
Q
What is indexing used for?
A
To access a certain position in the sequence.
2
Q
What does a positive index mean?
A
Using offsets starting from the first character.
3
Q
What does a negative index mean?
A
using offsets starting from the last character.
4
Q
What is slicing used for?
A
The act of selecting zero or more items of a sequence and forming them into a new sequence.
5
Q
What are the meanings of the first, second, and third numbers in a slicing operation?
A
first has offset 0, second has offset 1, and third has offset 3.