A Story of CompSci By Sophie Polson (net_id = sep45) (A loose parody of ‘A Visit from St. Nicholas’ by Clement Clarke Moore) ‘Twas the night before finals, when all through the dorm, The students were studying, awaiting the storm; The textbooks were thrown on the floor with dismay, With wishes of break to come quickly their way; The students were done and thinking of their beds; While visions of CompSci still danced in their heads; And you with your laptop, and I with mine too, Had just settled down with APTs to do, When upon the screen there arose such an error, I sank in my seat in defeat and in terror. I opened the tutor we all know by heart, The tutor for Python, to see where to start. The code with its for loops and while loops galore, Gave the tutor some trouble – oh what was in store, When what to my wondering eyes did appear, An error on line nine and now it was clear, With Python Tutor always here to assist, I knew in a moment it must be the list. I wondered how many types Python contains, And asked you, and said as you searched through your brain: “There’s integers! Strings! And there’s lists and there’s sets! And we can’t forget floats or we’ll have some regrets! To the bools that always will return False or True, Now parse that code! Change it! And then run it through!" As code that returns red more often than not, When run through ETester, do not get distraught; So back to Eclipse then we students did go, With code full of loops, and things we did not know— And then, after running, I hit refresh quite soon, I wanted to end this APT by noon!. As I fret about time, I open the outcome, The return was quite red, and so I became glum. I will break down my code for you just so you see, Exactly how frustrating this was to me; It begins with a function that makes a new list, A list made of sets, I think you get the gist. This list – how it’s different! The length – this time stable! It is a good thing we know lists are mutable! This code was made up of not one function but two, The helper keeps running as long as it is True; The point of the helper is to iterate, As long as we’re sure to use enumerate; The sets were compared and they were sometimes combined. Intersection and union should be kept in mind. If there were no more sets to combine and to pop, Then the helper is False and back up it will hop; A list comprehension is almost the end, But use neither index, nor count, nor append; Instead we’ll use one more list comprehension, And use one more method we forgot to mention. This method is join and after it is run, The sets will be gone and the program is done; After polishing the code it would then be seen, That running this program would result in all green. So this is a story of CompSci in the fall— The semester is done – happy finals to all!