Test Score
First Wrong
- this is the first thing I got wrong. I didn’t read the question with detail. It said we have to pick two answers in the choices. I didn’t see the sign so that I pick only one. D and A have a same meaning. A is pushing the maxPS at the beginning and D is pushing it when time is not greater than 120.
-
correct answer D: This code segment uses the IF statement to set maxPS to 30 when time > 120 and uses the ELSE statement to set maxPS to 50 otherwise.
-
correct answer A: This code segment sets maxPS to 50 by default, then uses the IF statement to set maxPS to 30 when time > 120.
Second Wrong
- This is the second thing I got wrong and this is also a same mistake with the first question. I thought I need to pick the word not a number when I saw the question. In the question, it says “The list wordList contains a list of 10 string values” and this attracts me. I thought string is a word, so I pick “hello”. However, I didn’t read the last part. The indices of a list are typically nonnegative integers, so it has to be the number which is not negative.
-
incorrect answer B: While the list elements are strings, the indices of a list are typically nonnegative integers.
-
correct answer D: Correct. List indices are typically nonnegative integers. The exam reference sheet describes a list structure whose index values are 1 through the number of elements in the list, inclusive. So, 4 would be considered a valid index.
Reflection
I thought I have to think slowly when I solve problem. These two problems are my mistakes that I didn’t read the question with detail. Now, I need to see and observe the question meticulously.