# "The Tao of Business" # Concept and Code by Noah King # for Reading and Writing Eletronic Text, Assignment 1, Spring 2010 # Professor Adam Parrish import sys searchTerm0 = " sage" searchTerm1 = "?" sectionBreak = "---" currentSection = 0 lineList0 = [""] lineList1 = [""] for line in sys.stdin: line = line.strip() if currentSection == 0: if searchTerm0 in line: lineList0.append(line) #comment out the below line for single-source inputs that do not contain --- section breaks if currentSection == 1: if searchTerm1 in line: lineList1.append(line) if sectionBreak in line: currentSection = 1 for i in range(0,20): if (i)%4 == 0: print i/4+1 print lineList1[i+1] print lineList0[i+1] if (i+1)%4 == 0: print "\n"