I wrote out the line of command on pen and paper so I could manipulate the physical and copy the line of code into the computer. I began with the stringName command which was stringName = “Tara Ashley Scranton”. I followed this code with stringName.split(“ “) and this created the listName. I needed to have my last name printed so I used this line of code (lastName = listName[-1]) which brought up Scranton. To create the number value to my last name, I counted the letters in my last name and multiply it by three. Code was written as so:
lastNameLen = 8
tripleLastName = lastNameLen * 3
No comments:
Post a Comment