This week was a shallow dive into the basics of Python scripting. We learned about basic variables, objects, functions, methods and how to use these elements to create a basic script. The script itself only had one input in the beginning. This input would be a users name. From there the script would take the variable with the name, turn it into a list for every name in the initial string that was separated by a space, and then print the last name to the screen. From there the length of the last name was determined and then tripled. The final part of the script was to print tripled count value of the last name to the screen. Here is a screen shot of how mine turned out.
The script was tested using a number of different name strings as the initial variable and the final outcome always printed whatever the last name and triple the number of characters in that last name. Again, this was all basic scripting to allow us to scratch the surface of script programming and get a feel for the basic elements of Python.
Let me know what you think in the comments below! I can also answer any questions on how to achieve this outcome efficiently as well.
The script was tested using a number of different name strings as the initial variable and the final outcome always printed whatever the last name and triple the number of characters in that last name. Again, this was all basic scripting to allow us to scratch the surface of script programming and get a feel for the basic elements of Python.
Let me know what you think in the comments below! I can also answer any questions on how to achieve this outcome efficiently as well.
No comments:
Post a Comment