Question 20
trains is a list that contains information about trains associated with a station stn. Specifically, each element in this list is a pair: [Arrival, Departure]. If the arrival or departure time is empty, it is represented as "None".
1 flag1 = False, flag2 = True 2 count = 0 3 foreach x in trains{ 4 if(first(x) == "None" or last(x) == "None"){ 5 flag1 = True 6 } 7 else{ 8 count = count + 1 9 }10 }11 if(count == length(trains)){12 flag2 = False13 }Based on the above data, answer the given subquestions.
At the end of execution of the code given, what can be said about the values stored by the Boolean variables flag1 and flag2?
flag1 and flag2 always store the same value
flag1 and flag2 always store opposite values
flag1 always stores the value True
flag2 always stores the value True