Going to Learn Python Now : Pt. 5

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”

Exercise 27: Memorizing Logic

  • -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 🙁

Exercise 28: Boolean Practice

  • -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

Exercise 29: What If

  • -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.

Exercise 30: Else And If

  • -shortening “else if” down to “elif” makes sense to me

Exercise 31: Making Decisions

  • -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

Exercise 32: Loops and Lists


  • 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”

Exercise 33: While Loops


  • i = i + 1

    could be replaced with

    i += 1

    but python doesn’t understand

    i++

Progress!