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
2
Q
Separator
A
Character(s) that indicate where to split string into tokens
3
Q
List
A
Container that groups related objects together in sequence from left-to-right
Mutable
4
Q
List Nesting
A
List as an element of another list
Allows for a multidimensional data structure
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
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]