Created
February 21, 2010 10:08
-
-
Save infynyxx/310241 to your computer and use it in GitHub Desktop.
python enumeration
This file contains hidden or 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
#this is more clearer than below code | |
for i,n in enumerate(x): | |
if x[i] < 0: | |
print "Found negative nunber @ index ", i |
This file contains hidden or 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
for i in range(len(x)): | |
if x[i] < 0: | |
print "Found negative nunber @ index ", i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment