lists
Mathematical Programming with Python
https://people.sc.fsu.edu/~jburkardt/classes/...
python_2025/lists/lists.html
lists:
define a variable which is a collection,
delimited by {[*,*,*]}; add or remove elements from the list.
A for() loop can be used to access each item of a list
in order. When Python reads a text file, this results in a list of
each line, which is a list of words, or else a single list of all the
words. A list can include lists, or items of different types.
To copy a list, use .copy() rather than
an equal sign!
Lecture notes:
-
five_letters.txt,
a list of five-letter words, which Python can read and
process with split() or strip().
-
grook.txt,
a four line poem, whose lines or words are to be read into
a list.
-
python_list.py
-
grades.py,
how to sort a list of (student, letter grade, numeric grade) records.
-
solar.py,
creates lists representing some planets, then creates a list of planets.
Assignment #2 due on Friday, 31 January:
Last revised on 21 January 2025.