I think my first instinct was to panic about writing code on my own, albeit simple code. I then remembered what we learned the previous week regarding a logical way to tackle programming. That is, defining the information given , sorting out the goals of the program, and thinking about what tasks will help in achieving the aims of the program. Also, I realized that this program wasn't so bad. In fact, as I looked over what needed to be done the wheels in my head were already turning with how to go about writing this program.
This may not be efficient in the future but I wrote pseudocode on paper first. I then tried out portions of the code to test them in the Python window of ArcMap. Once I felt like I had it down I composed the final script in PythonWin. You can see a screen shot below showing the result of my script.
This is a screenshot of the result of the program composed for this exercise. The program prints my last name and the integer value of the number of characters in my last name times three. |