Q6Multiple correct6 Marks22 Dec 2024
Consider the following pseudocode executed using the "Words" dataset. Which of the following statements is/are true? It is a Multiple Select Question (MSQ).
A = 0, flag = True
initList = [], outList = []
while(Table 1 has more rows){
Read the first row X in Table 1
if(flag){
initList = [X.Word]
flag = False
}
if(X.Word ends with a full stop){
outList = outList ++ [initList ++ [X.Word]]
A = A + 1
initList = []
flag = True
}
Move X to Table 2
}
Topic Mapping: chapter: Week 5 │ topic: Lists — Iteration and Processing │ subtopic: Building a nested list of sentence start and end words using flag-controlled state tracking