Skip to main content
PEP 8. Internal formatting (only one backtick is necessary for inline).
Source Link
Peter Mortensen
  • 31.1k
  • 22
  • 111
  • 134

You can use enumerate and embed expressions inside string literals to obtain the solution.

This is a simple way:

a=[4a = [4, 5, 6, 8]
for b, val in enumerate(a):
    print('item #{} = {}'.format(b+1, val))

You can use enumerate and embed expressions inside string literals to obtain the solution.

This is a simple way:

a=[4,5,6,8]
for b, val in enumerate(a):
    print('item #{} = {}'.format(b+1, val))

You can use enumerate and embed expressions inside string literals to obtain the solution.

This is a simple way:

a = [4, 5, 6, 8]
for b, val in enumerate(a):
    print('item #{} = {}'.format(b+1, val))

You can use enumerateenumerate and embed expressions inside string literals to obtain the solution. 

This is a simple way:

a=[4,5,6,8]
for b, val in enumerate(a):
    print('item #{} = {}'.format(b+1, val))

You can use enumerate and embed expressions inside string literals to obtain the solution. This is a simple way

a=[4,5,6,8]
for b, val in enumerate(a):
print('item #{} = {}'.format(b+1, val))

You can use enumerate and embed expressions inside string literals to obtain the solution. 

This is a simple way:

a=[4,5,6,8]
for b, val in enumerate(a):
    print('item #{} = {}'.format(b+1, val))
Source Link
Kofi
  • 1.3k
  • 1
  • 13
  • 22

You can use enumerate and embed expressions inside string literals to obtain the solution. This is a simple way

a=[4,5,6,8]
for b, val in enumerate(a):
print('item #{} = {}'.format(b+1, val))