Python Fundamentals

This week in GIS Programming, we learned about the basics of Python, including working with string variables, function and method calls, importing modules, running and saving Python script using Notebook in ArcGIS Pro, including comments in scripts, creating loops and conditional statements, and using iterate variables within loops to control script workflow.

In this activity assigned, I split and printed my full name, I fixed errors in a pre-written code for a dice game, which was ran, created a loop that added 20 random numbers between 0 and 10 to a list, then created a loop that removed a chosen integer from this list, and concluding with printing statements on the outcome of the random number selected, the instances of its occurrence, and an updated listed without the chosen number.  

 This flowchart shows the workflow for the activity:

 
 This screen shot shows the output of the script I wrote:

 
I found this lab challenging and time intensive, but overall, I feel that it helped me learn some basics of scripting in Python. After reviewing the assigned reading and lectures in the class, I found no problem in understanding the basic commands or syntax, but rather my difficulty was in understanding how to string together the syntax from various operations.  I am relieved, however, that I was able to complete this assignment in a timely fashion. 
 
 



Comments

Popular posts from this blog

GIS Portfolio

Remote Sensing Final Project