Users Are Mean and They Keep Breaking My Code
The journey from 0 to now.
So that’s why I figure out ways to foil their dastardly plans.
That’s the name of the game with this code I’ve been working on for the Noisebridge class I’m in. It’s a modified version of one of the exercises in Think Python where they want you to write code that will output a 4x4 grid. In the modified one for the Noisebridge class, they wanted us to write code that would output a grid to the users’ specifications.
As for what I’ve been learning, I’ve been learning how to better use raw input, loops (only for loops for now) and learning how to nest them. I’ve also been told that if __name__ = ‘__main__’ is important, although I don’t quite get it yet. Soon, hopefully!
So, here’s some code that I wrote. I wrote two versions of it, but they both do the same exact thing. They’re also both hideous! So if anyone has any comments or ways I can improve it (obviously there are), they’re welcome. Keep in mind, I’m writing code with fairly limited knowledge of Python and other sorts of loops, that’s why I kept it to for loops, although my partner working on the same problem used a while loop and it worked just as well.
https://gist.github.com/uriah-sayres/7113124
That’s it for now. I’ve still some reading I have to do before the class tomorrow, but otherwise, I’m really glad that I was able to write this from scratch and the only thing I stumbled over was figuring out the vertical multiplication of making the grid.
Email me when Uriah publishes or recommends stories