From 2246b4f9af4843cda97898b960ed4c9cd1136052 Mon Sep 17 00:00:00 2001 From: Christopher Burns Date: Sun, 27 Jun 2010 15:16:54 -0500 Subject: REF: Reformat some of the if-blocks so it's a little more clear. --HG-- branch : scipy2010 --- day1/session3.tex | 20 +++++++++++--------- 1 file 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} -- cgit