Hard Won Numbers:The final output of this lab may not look like much, but it represents plenty of single-line-print()-checks and “breaks for fresh air”. |
In the first weeks of the GISProgramming course we were
asked to get familiar with different systems for writing python code, and to complete
a handful of simple tasks using python. These included a code that would print
your last name given the full name as a string, edit and run a code that played
a simple dice game, and create code to build a list of random numbers and then automatically
edit a given “unlucky number” out of the list.
While we were given the information we needed in the exercises,
lectures, and readings, once the different individual tools started to stack
and interact with each other, there was still plenty of space for syntax errors
and arguments that wouldn’t accomplish their goal. I am happy to say though
that for every blank frustrated stare and break for fresh air, there were
experiential lessons learned, and new personal checks formed.
As someone who thought I understood python basics already, I can say it takes more than one infinite loop to realize when your arguments just won’t work.
When Things Get Variable: What happens your loop-breaking argument isn’t a valid argument. |
Once the code for each task was built, checked, and running properly, the process looked like this:
- Check your classes
- len() isn't a good argument to use as a loop breaker
- Utilize different consoles to run entire files, run single lines, or edit with more/less prompts and tips
- Super helpful to print() individual lines or blocks, then just comment it out
- Check your classes
- Worthwhile to have a flowchart, even just a quick sketch, when working with a long multi-outcome block of code
No comments:
Post a Comment