Wednesday, May 27, 2020

Python Fundamentals

This week our lab focused on the fundamentals of Python programming language. It was a great exercise to get familiar with the syntax, basic functions, and overall structure of entering a basic script. Our task was to create a dice game script. The first part of the script was given but I had to identify the two errors. I found this part to be easy because I entered the existing code in the ArcPro Python Window and it identified which lines had errors and what they were. Even at my beginners level, I could figure out what to change. The more challenging part of this assignment was creating one while loop that generated 20 random numbers between 0 and 10, and to choose an integer and count how many times it appeared in the list and then remove it. This assignment took plenty of trial and error. Below I have shared a screenshot of the results of my script and a flowchart of how I got
there.






No comments:

Post a Comment