Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
- Sequence Operations 0:57
- Slices 4:29
- Creating Slices 1 objective
- Len, Min, and Max 3:04
- Finding len, min, max 3 objectives
- Membership Testing 2:16
- Count and Index 4:38
- Code Samples: Membership Testing, Count, and Index
- Concatenation and Multiplication 3:04
- Sequence Operations Cheat Sheet
- Recap of Sequence Operations 4 questions
Instruction
Code Samples: Membership Testing, Count, and Index
List & Tuples
Membership Testing
fruits = ['apple', 'banana', 'orange', 'pear', 'strawberry']
vegetables = ('asparagus', 'corn', 'broccoli', 'eggplant', 'onion')
'eggplant' in fruits # False
'eggplant' not in fruits # True
'eggplant' in vegetables # True
'eggplant' not in vegetables # False
Index
my_pets = ('dog', 'cat', 'cat', 'chicken',...