diff options
author | Christopher Burns | 2010-06-27 15:16:54 -0500 |
---|---|---|
committer | Christopher Burns | 2010-06-27 15:16:54 -0500 |
commit | 639a16e6bee7ea1a9dc668c8611ca16ff2e18cf2 (patch) | |
tree | 7ca6e39dcfe4642dc4a7726c2f19cf302adc0176 /day1 | |
parent | 81336706b80aec34163f1928a91b4c91024ee726 (diff) | |
download | workshops-639a16e6bee7ea1a9dc668c8611ca16ff2e18cf2.tar.gz workshops-639a16e6bee7ea1a9dc668c8611ca16ff2e18cf2.tar.bz2 workshops-639a16e6bee7ea1a9dc668c8611ca16ff2e18cf2.zip |
REF: Reformat some of the if-blocks so it's a little more clear.
--HG--
branch : scipy2010
Diffstat (limited to 'day1')
-rw-r--r-- | day1/session3.tex | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/day1/session3.tex b/day1/session3.tex index 02aef4f..26f205a 100644 --- a/day1/session3.tex +++ b/day1/session3.tex @@ -361,16 +361,17 @@ for record in open('sslc1.txt'): \begin{frame}[fragile] \frametitle{Building parsed data \ldots} \begin{lstlisting} -if region_code not in science: - science[region_code] = 0 + if region_code not in science: + science[region_code] = 0 -score_str = fields[6].strip() + score_str = fields[6].strip() -score = int(score_str) if \ - score_str != 'AA' else 0 + score = 0 + if score_str != 'AA': + score = int(score_str) -if score > 90: - science[region_code] += 1 + if score > 90: + science[region_code] += 1 \end{lstlisting} \end{frame} @@ -425,8 +426,9 @@ for record in open('sslc1.txt'): fields = record.split(';') score_str = fields[5].strip() - score = int(score_str) if \ - score_str != 'AA' else 0 + score = 0 + if score_str != 'AA': + score = int(score_str) math_scores.append(score) \end{lstlisting} |