![]() |
| Results of created script showing the length of my last name multiplied by 3. |
This blog follows my journey as a student in the Geographic Information Science Online Certificate program at the University of West Florida. Laying a visual path from beginner to graduate, I invite you to share in my adventures.
Tuesday, May 26, 2015
Module 2 - Python Fundamentals Part 1
This week was a nice introduction to creating our own script. Our goal was to create a script that started with a string of our full name and ended with the results of our last name multiplied by 3. Starting with creating the string name, followed by splitting, indexing, getting the length of our last name, and then the final multiplication and print steps. The trickiest part was figuring out how to take the last name index and obtain the length of the last name. After a little trial and error and rewatching the lecture video I realized I was using a method when I should be using a function. Problem solved, I completed the script and ran it in PythonWin to be sure it would work for any value inserted into the script (i.e. someone else's last name). Success! My first real script figured out!
Labels:
GIS5103
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment