Learning to Program in Python for Kids

of all ages  by Philip M Russell

an imageLists are a different kind of variable. What if you want to store a long list of information, which does not change? For example, suppose you need to store the names of the months of the year. This is where lists are ideal.

months = ['January','February','March','April','May','June','July','August','September','October','November','December']
print (months [6])


Now all of that looked ok until you realised that the sixth month is June and the computer gave us the answer July.

So lets try another go.

numbers = [1,2,3,4,5]

print (numbers [2])


 So I say print the 2nd item and you give me the Third number?????


I count that the first number is put into box 0 then the next number is put into box 1. So the work with lists you always count from zero.

 Lets try some simple exercises Click Here

More List Things.