Results of Mod2_MThrush.py running script in PythonWin |
After creating the script and running it successfully, I created a flow chart. I know this process should be reversed; create the flowchart and then create the script. This is a habit I will need to form as scripts will become more complex.
Flow Chart of Mod2_MThrush.py which prints the last name of an assigned full name string and the value of three times the length of the last name. |
While I was completing the Process Summary, I realized there was a way to reduce at least one line of code in my script. After successfully running my second script, I found an additional line that I could remove. My final script contained 5 lines of code and produced the same results. There is always more than one way to solve a problem or "skin the cat", especially with scripting/programming. Editing and modifying my original script enabled me to get some experience using Python Win and to better understand Python syntax.
No comments:
Post a Comment