Saturday, May 21, 2016

Python Fundamentals Part 1


  For this lab, a script was made that would preview my full name, last name, and then the number of letters in my last name multiplied by three. 

   The full script included a written string of my full name, the string made into a list that split into individual names, my name indexed through printing, a function to find the length of my last name, a statement that multiplied the length of my last name by three, and the printing of the last name length multiplied by three.

   Here is an excerpt of how I calculated the length of my last name in PythonWin:
1.       This function wasn’t a task in the lab exercise, but I remembered it being used as a function in the reading.
2.       I wrote the first code as: name = “Priscilla Marie Woodrow”             len(Woodrow). Which was wrong because I forgot to add quotation inside the parenthesis, which specifies the object.

3.       It runs as: name = “Priscilla Marie Woodrow”          len(“Woodrow”)

No comments:

Post a Comment