Skip to main content
typo
Source Link
SuperStormer
  • 5.5k
  • 5
  • 30
  • 40

It's pretty simple to start it from 1 other than 0:

for index, item in enumerate(iterable, start=1):
   print index, item  # Used to print in python<3.x
   print(index, item) # MirateMigrate to print() after 3.x+
   

It's pretty simple to start it from 1 other than 0:

for index, item in enumerate(iterable, start=1):
   print index, item  # Used to print in python<3.x
   print(index, item) # Mirate print() after 3.x+
   

It's pretty simple to start it from 1 other than 0:

for index, item in enumerate(iterable, start=1):
   print index, item  # Used to print in python<3.x
   print(index, item) # Migrate to print() after 3.x+
   
print() function modified according to python 3.x+
Source Link
mhhabib
  • 3.2k
  • 1
  • 20
  • 35

It's pretty simple to start it from 1 other than 0:

for index, item in enumerate(iterable, start=1):
   print index, item  # Used to print in python<3.x
   print(index, item) # Mirate print() after 3.x+
   

It's pretty simple to start it from 1 other than 0:

for index, item in enumerate(iterable, start=1):
   print index, item

It's pretty simple to start it from 1 other than 0:

for index, item in enumerate(iterable, start=1):
   print index, item  # Used to print in python<3.x
   print(index, item) # Mirate print() after 3.x+
   
Note no longer relevant since tuple being unpacked.
Source Link
ShadowRanger
  • 158.2k
  • 12
  • 224
  • 318

It's pretty simple to start it from 1 other than 0:

for index, item in enumerate(iterable, start=1):
   print index, item

Note

Important hint, though a little misleading since index will be a tuple (idx, item) here. Good to go.

It's pretty simple to start it from 1 other than 0:

for index, item in enumerate(iterable, start=1):
   print index, item

Note

Important hint, though a little misleading since index will be a tuple (idx, item) here. Good to go.

It's pretty simple to start it from 1 other than 0:

for index, item in enumerate(iterable, start=1):
   print index, item
Post Undeleted by Jean-François Fabre
Post Deleted by Jean-François Fabre
added 11 characters in body
Source Link
A.J.
  • 9.1k
  • 13
  • 67
  • 92
Loading
Copy edited. (its = possessive, it's = "it is" or "it has". See for example <http://www.wikihow.com/Use-Its-and-It%27s>.)
Source Link
Peter Mortensen
  • 31.1k
  • 22
  • 111
  • 134
Loading
deleted 1 character in body
Source Link
A.J.
  • 9.1k
  • 13
  • 67
  • 92
Loading
added 116 characters in body
Source Link
A.J.
  • 9.1k
  • 13
  • 67
  • 92
Loading
Source Link
A.J.
  • 9.1k
  • 13
  • 67
  • 92
Loading