Saturday, May 23, 2026

Python, Dice Games, and Mild Panic: Module 2 Adventures

 

Python, Dice Games, and Mild Panic: Module 2 Adventures


Module 2 Flowchart


This week’s GIS Programming assignment was my first real experience working through a full Python script from start to finish. Going into the lab, I was honestly expecting programming to feel overwhelming and full of confusing syntax errors every five minutes. While there were definitely a few moments of staring at the screen wondering why one tiny typo could break everything, it was actually pretty satisfying once the script finally worked.

The assignment focused on Python fundamentals like variables, lists, loops, conditionals, and random number generation. One of the first tasks was splitting my name into a list and printing only my last name using indexing. That part was straightforward and helped me understand how lists work in Python.

The dice game section was where things became more interesting. I had to identify and fix errors in the provided code, which mostly involved correcting capitalization and converting numbers into strings for print statements. It was a good reminder that Python is extremely picky about syntax and capitalization. Apparently one uppercase letter can completely derail your confidence for ten minutes.

The random number section was probably the most fun part of the assignment. Watching the list populate with random integers and then removing the “unlucky” number made the script feel a little more interactive instead of just typing commands into the void. I also got more comfortable working with while loops and understanding how counters control when a loop stops running.

I completed the script in Python, copied it into ArcGIS Notebook, and then exported the final version as a .py file. Running the script successfully in both environments felt like a small but important victory. It definitely made programming feel a little less intimidating than it did at the beginning of the module.

Overall, this lab was a solid introduction to Python fundamentals and helped me better understand how scripts are structured. I still expect future assignments to challenge me, but at least now I know that most errors are usually caused by one missing parenthesis, one quotation mark, or Python deciding that capitalization suddenly matters more than my feelings.


ArcGIS Pro Notebook results


No comments:

Post a Comment

Module 3 - Coastal Flooding

 Coastal flooding is one of the most destructive hazards associated with hurricanes, making accurate flood modeling an important component o...