106 Introduction to Computational Models with Python
an item with value 5. Line 8 has a for statement that de fines the loop that
iterates with loop counter j starting with 1 up to SIZE. The value of the
current item is computed in line 9 and it is placed at the end of the current
list using the append list method in line 10. Note that the variable item r efers
to the value of an individual item of the list. This Python script is stored in
file blist5.py.
Listing 7.3 Python program with a list of values that are multiples of 5.
1 # Script: blist5.py
2 # Python script to build a list with
3 # items with values multiple of 5
4
5 SIZE = 15 # number of items in list
6 listmf = [] # create empty list
7 # the list starts with 5
8 for j in range (1, SIZE+1):
9