Search & Reverse a List
Finding a Targetted Value
.index(target, start, end)
method will find the first occurance of the target if it exists.
If the target does not exist, it raises and error
Both
start
andend
arguments are optionalThey act like slicing mechanism, we can look for the index of a value within such boundaries
Counting the Number of Occurrence of a Target
.count(target)
method counts the number of times target occurs.
If target does not exist, returns 0
Mutate and Reverse a list
.reverse()
will reverse the order of the items in the list
Last updated