Wednesday, May 29, 2019

GIS Programming - Module 2 Lab

Python 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 11:27:44) [MSC v.1900 64 bit (AMD64)] on win32

>>> print ("Hello Everyone!") 

Hello Everyone!


This week’s lab was all about learning the basics of Python! For this week’s lab, I had three separate coding exercises. For the first exercise, I was tasked with printing my last name from a created list. For the second exercise, I had to edit the given script for a dice game with a handful of errors that would prevent the script from running and import a specific Python module. Finally, for the last exercise, I was tasked with creating a script that creates a list of twenty random integers between 0 and 10 and then select and remove every occurrence of a specific integer and print the newly updated list. As you can see below these were the basic flowcharts I created to help me construct my scripts for parts one and three as they were the scripts I needed to write myself and not edit.



After writing and editing my scripts, these were the results.



As you can see the script successfully printed my last name, the prewritten script that I edited and corrected errors ran for the dice game, and it created the list of twenty random integers, selected the unwanted integer, and removed all instances of the integer and printed an updated list. I really enjoyed this week’s lab as it brings back really good memories of when I first started Python, and I look forward to sharing my future progress with you!

~ Code On!

No comments:

Post a Comment