Tuesday, May 28, 2013

Python Basics I


We started into the Python language this week.  I've been programming for many years, so this week's exercises were pretty easy for me.  However, I would encourage my GIS classmates who aren't familiar with programming to spend some time on the exercises. We're covering really important basics in programming for any language.  Fortunately, Python has pretty easy syntax, so once you get the basic flow of it, you can solve a lot of problems just by looking through the various methods and functions that are available for each data type.

The image above is my results from the lab exercise.  In Part 1 of the lab, we calculated the length of our last name and then multiplied that value by 3.  In Part 2 (grad students), we had to calculate the number of times the letter "e" appears in our middle name and then divide it (as a float) by the number of letters in our middle name.  Unfortunately, there are no e's in "Brian" so my result is a little boring.

No comments:

Post a Comment