Learning to Program in Python for Kids

of all ages and Linux on a Raspberry Pi by Philip M Russell

We can add items to lists.

Using .append


Here is the program

count = 0

newlist = [1,2,3] # Here is my list

print ("Using a for loop to print out the original numbers")

for count in newlist:

 print (count)

count = 0

newlist.append(4)

newlist.append(5)

newlist.append(6)

print ("Using a for loop to print out the numbers")

for count in newlist:

 print (count)