Chapter 7 - Indexing and Slicing of Sequences Flashcards

1
Q

What is indexing used for?

A

To access a certain position in the sequence.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does a positive index mean?

A

Using offsets starting from the first character.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does a negative index mean?

A

using offsets starting from the last character.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly