Sunday, May 23, 2021

 First assignment for GIS Programming (GIS 5103). The first assignment for this course was an introduction to python coding. We began by getting familiar with the Python applications and simple coding language and functions. After a few exercises to get familiar with our new environment we began to really get into the first part of the assignment. One of the simple tasks was to break down a string and then print a selected item, in this case my last name. 

The first more complex task of this weeks assignment was to fix some errors in a code that ran a dice game. Fixing the errors in the code was a fairly straightforward task as it only involved adding a random function and changing a couple syntax errors. 

The second major part of our assignment was more difficult and dealt with the creation of while loops. The first while loop we created appended random numbers into an empty list. Following the populating of a list with 20 random numbers between 1 and 10 we had to choose a number to remove from the list. Removing a number was accomplished with another while loop. After the remove function and while loop finished working a new list without our selected unlucky number was printed. 

Below is a screenshot of the output from all the code that was written in this assignment. 



 It was interesting to see how while loops and if statements could be used to carry out such diverse operations. This assignment was difficult as I had very little coding experience but after working through the assignment it started to make sense. At first I had to write out the operations I needed and determine what had to be coded and how things would relate. After a little practice I could anticipate what needed to written out. 

No comments:

Post a Comment

GIS 6005 Communicating GIS Final I have reached the final assignment of this course. This week we had to put all the skills that we learned ...