Page 187 -
P. 187
comprehending data
Let’s write the code to convert your existing data into a sanitized version of itself. Create four
new lists to hold the sanitized data. Iterate over each athlete’s list data and append each
sanitized string from each list to the appropriate new list. Conclude your program by printing a
sorted copy of each new list to the screen.
The code that with open('james.txt') as jaf: data = jaf.readline()
reads the data james = data.strip().split(',')
from the data with open('julie.txt') as juf: data = juf.readline()
files remains julie = data.strip().split(',')
unchanged
(and has been with open('mikey.txt') as mif: data = mif.readline()
compressed to fit mikey = data.strip().split(',')
on this page). with open('sarah.txt') as saf: data = saf.readline()
sarah = data.strip().split(',')
Add your new
code here.
What happens
to the four
“print()” print( )
statements? print( )
print( )
print( )
you are here 4 151