Created
February 5, 2019 07:07
-
-
Save Robofied/f21de16188e406394453166fc14ddc18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Checking the index of '1' | |
l3.index(1) | |
#[Output]: | |
#1 | |
## Here we start searching beyond the index in which '1' lies so it throws ValueError | |
l3.index(1,2) | |
#[Output]: | |
#--------------------------------------------------------------------------- | |
#ValueError Traceback (most recent call last) | |
# in () | |
# 1 ## Here we start searching beyond the index in which '1' lies so it throws ValueError | |
#----> 2 l3.index(1,2) | |
#ValueError: 1 is not in list | |
## count() method. | |
l4 = [1,2,3,2,3,4,5,6] | |
l4.count(3) | |
#[Output]: | |
2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment