For this challenge, use the requirements for challenge A-3 in the 1992 Niagara South Programming Competition. For the input, create a text file called "MapleLeafs.txt" with the scores entered as follows: 2 4 5 3 12 5 1 7 3 3 1 5 6 2 12 1 3 6 1 1 #Python Example to read in scores
# initialize the arrays gameScores=[] individualScores=[] # open file, read the scores into the array, close file file = open("MapleLeafs.txt", "r") gameScores = file.read() file.close()
# split the gameScores into separate scores individualScores = gameScores.split() Save as "NS1992A3-MapleLeafs". |