Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Well done!

You have completed Python Sequences!

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', 'dog') my_pets.index('dog') # 0 my_pets.inde...