# HG changeset patch # User Puneeth Chaganti # Date 1271149358 -19800 # Node ID 3d2c2c0bc3e29b57890551b8118422a78aac6f57 # Parent 53700ad0e71eed3867483a96db863c41756363f3 More edits to statistics.txt. diff -r 53700ad0e71e -r 3d2c2c0bc3e2 statistics.txt --- a/statistics.txt Tue Apr 13 14:26:52 2010 +0530 +++ b/statistics.txt Tue Apr 13 14:32:38 2010 +0530 @@ -119,11 +119,11 @@ We first create an empty dictionary science = {} -now we read the record data one by one from the file sslc.txt +now we read the records, one by one from the file sslc.txt for record in open('sslc.txt'): - we split the record on ';' and store them in a list by: fields equals record.split(';') + we split each record on ';' and store it in a list by: fields equals record.split(';') now we get the region code of a particular entry by region_code equal to fields[0].strip. The strip() is used to remove all leading and trailing white spaces from a given string @@ -135,7 +135,7 @@ Note that this if statement is inside the for loop so for the if block we will have to give additional indentation. - we again come back to the older 'for' loop indentation and we again strip the string and to get the science marks by + we again come back to the older, 'for' loop's, indentation and get the science marks by score_str = fields[6].strip() we check if student was not absent @@ -161,3 +161,4 @@ savefig('science.png') That brings us to the end of this tutorial. We have learnt about dictionaries, some basic string parsing and plotting pie chart in this tutorial. Hope you have enjoyed it. Thank you. +#slide of summary.