For Question 1, the output of the print statement will be:
- 32; number
This is because the length of the string "One can never have enough socks." is 32 characters, and the data type of the output (when printed) is indeed a number (specifically, an integer).
For Question 2, the output of the print statement will be:
- Cersei
When the split(",")
method is called on the string studentNames
, it splits the string into a list at each comma. The resulting list is ["Arya", "Berric", "Cersei", "Drogo", "Eddard"]
. Therefore, studentList[2]
refers to the third element in the list, which is "Cersei".