Saturday, January 26, 2013

21-27 January 2013


This week in Computer Science, we continued our examination of Python.  In particular, we studied graphics.  We used a graphics library to draw a graph of the temperature and heat index.  Yay.

The phrase which most sums up the week is “from graphics import *”.  I forgot what this line did the first time on a quiz, and later we used it in the lab.  For clarity: this line imports the graphics library and allows one to use its functions, like “import graphics”, but allows one to- later in the program- write “draw.something” instead of “graphics.draw.something”.  I’m not even sure the syntax with “draw” is correct; it’s astounding how quickly one forgets the rules of syntax.

So we’re progressing, though I’m not sure how quickly.  The pace has slowed down to one lab per two class days.  At the very least, though, we’re undoubtedly learning something (Python) that we didn’t know before.

Monday, January 21, 2013

14-20 January 2013


This week, we delved further into Python, despite an interruption from the symphony.  This interruption led to us concluding only one lesson in two days, namely functions.  Functions are the same as Jeroo methods- a few lines of code that are first defined and can later be called on multiple times.  I do not, however, understand the value of- as in our examples- putting everything in functions and then calling the main function once; it seems unnecessarily confusing, even if it does hold some value for error detection.  Still, if it stood the test of time….

I will not go into the mechanics and syntax of how functions work, but I will note that, unlike in Jeroo, functions can be of variables.  That is, a function can have inputs and an output both, as well as doing something in its body whenever called.  The indent of three spaces reappeared, symbolizing organization- an indented line might be part of a function’s definition, etc..  Finally, we “wrote” a program that calculated the heat index and then printed out a string based on its numerical value.

Overall, we seem to be progressing quickly towards the parts of Python with no Jeroo analogues.  That seems like a good thing.

Sunday, January 13, 2013

7-13 January 2013

This week marked a return to Computer Programming.  We started Python in earnest; I think I didn't understand, before, that Jeroo was an entirely separate thing from Python; either way, we've started a new unit.  There are similarities in syntax, but Python is more general.  We learned, also, about the varied types of objects in Python including floating point numbers (with a decimal point) against integers.