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
Sequence Operations Cheat Sheet
Sequence Operations Common to All Types
Concatenate
Attaches one sequence to the end of another
nums1 = [1, 2, 3]
nums2 = [4, 5, 6]
nums3 = nums1 + nums2 # [1, 2, 3, 4, 5, 6]
Count
Returns the number of times an item appears in a sequence
student_gpas = [2.5, 4.0, 3.2, 2.9, 3.7, 1.5, 4.0]
student_gpas.count(4.0) # 2
In
Retu...