Module 2 GIS Programming: Python Fundamentals
Hello all, the second week of GIS Programming (4102/5103) was focused on learning the fundamentals of Python. This included topics such as loops, formatting, lists, sets, and many other basic functions/methods used in Python scripting. As I've said before, the Zandbergen (2020) book helped a lot with figuring out how to do a lot of this. This week we were tasked first with creating a set of names and splitting it into a list. This was simple enough and was a good introduction to creating and indexing a list. The harder parts of the assignment were correcting the dice code and creating a randomly generated list using a while loop.
I've provided my results from the code down below:
The dice code had two errors, which took me longer than I expected to figure out. The first error was a syntax mistake in a print code that needed to be cast. The second error was simply a capitalized X instead of a lowercase x. I have included a flowchart of the logic behind the dice script. This flowchart of the logic is part of what helped me to figure out the errors since I was able to break down the script and digest it.

.png)

Comments
Post a Comment