Tuesday, June 3, 2014

GIS 5103 Module 3: Python Fundamentals Part 1



The screenshot above might not seem that impressive, yet it is the output of our Module 3 assignment for GIS Programming.  I am happy to get to this module, as it begins to introduce the building blocks of Python scripting.  The previous two modules saw us using scripts with syntax we did not understand.  Now, however, we are learning the details of Python scripting.  The structure of the module, providing examples in the exercise then requiring us to write a script with very little instruction in the assignment, works well to force us to think of the logic of the syntax and how to structure our script.

The assignment required us to write a script that created a string of our name, then to perform various actions on that string.  We had to split our full name into a list, then print our last name using indexing, then create a variable for the length of our last name, then multiply that value by three, and finally to print that value.  The only output of the script should be our last name and the final value.  It was a fun assignment that forced us to pay attention to the details of our syntax to avoid errors.  I look forward to learning more Python basics in module 4.

No comments:

Post a Comment