Saturday, May 27, 2017

GIS Programming Module 2: Python Fundamentals

This week in GIS Programming was a crash course (for me, a welcome review) of the basics of Python syntax and how to manipulate different data types. The lab assignment was to write a short script that began with a string containing my full name, extracted the last name, calculated its length, and ultimately returned the last name and a number three times the number of characters it contains. This output is pictured below:


The steps in the coding process went something like this: assign full name to a variable --> split string into list --> print the last item in the list --> calculate the length of the last item in the list --> multiply it by 3 --> print that result.

No comments:

Post a Comment