Strings and Lists Flashcards

1
Q

String Slicing

A

Indicate multiple consecutive characters that are created as a new substring from the string object
Updating the string doesn’t update the slice

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

Separator

A

Character(s) that indicate where to split string into tokens

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

List

A

Container that groups related objects together in sequence from left-to-right
Mutable

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

List Nesting

A

List as an element of another list

Allows for a multidimensional data structure

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

Slice Notation

A

Range of elements, numbers separated by colon

my_list[0:2] - includes from beginning index to 1 less ending index

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

List Comprehension

A

Modify every element in the list the same way and returns a new list
new_list = [(i+5)] for i in my list]

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