The following code:
c=0 while c < len(demolist):
print ’demolist[’,c,’]=’,demolist[c]
c=c+1
Creates this output:
demolist[ 0 ]= life
demolist[ 1 ]= 42
demolist[ 2 ]= the universe
demolist[ 3 ]= 6
demolist[ 4 ]= and
demolist[ 5 ]= 7
demolist[ 6 ]= everything
What's up with the demolist[',c,'] format that is being printed in the while loop? Why does this give a number in the brackets, whereas putting demolist[c] there just prints that exactly?