Alright, it’s been a grueling, hard day of playing Rogue Legacy… now for a breather with some relaxing python.
We’re into lessons 26 -> 33 of http://learnpythonthehardway.org/book/
Exercise 26: Congratulations, Take a Test!
- -so this one is an exercise in correcting bad code, copy and paste then analize and fix
- -I think I’ve got it all fixed… however the shit that’s happening in the file is kind of arbitrary… so without a “correct” version to compare with, I’m not 100% sure that it’s all done the way it’s supposed to be. But that said, I’ve fixed lots of mistakes and it all seems to compile and “make sense”
- -supposedly I’m to memorixe the tables here over the course of a week. I laugh in the face of memorization.
- -though looking at the tables, these are terms I’m already familiar with from C++ and Hscript and VEX… so… wheee
- -yeah, nothing new here
I used roller blades (inline skates) for the first time yesterday. I fell backward, and hit my head on the concrete. I’m glad I was wearing a helmet, but my neck is stiff 🙁
- -I haven’t seen
not (True and False)
before, but I totally understand it. It’s odd that there’s a space between the not and the parentheses though.
- -so the act of typing this in python was new, but the concept is not new
- -still getting used to the idea of colons and indents being the only thing that sets something as a function. I’m so used to the curly brackets, and semi-colons.
- -Nothing else about this is new though.
- -shortening “else if” down to “elif” makes sense to me
- -I think I’d prefer to use %r over %s in ithe “well, doing %s is probably better” part as it repeats what you’ve typed back with quotation marks.
- -hooray for text adventures
- –
for number in the_count:
seems a little odd to me… we’re doing a for loop but not really specifying what it is we’re counting… I guess python just “knows” that we’re processing everything in the list?
- -I guess the take away here is just to remember that we use the word “list” rather than “array” or “matrix”
- –
i = i + 1
could be replaced with
i += 1
but python doesn’t understand
i++
Progress!