25) What is the value of "c" after the following code executes? a = [10, 50, 20] b = [30, 60, 40] c=b+a a. [10, 20, 30, 40, 50, 60] b. [10, 50, 20, 30, 60, 40] C. [30, 60, 40, 10, 50, 20) d. error 26) What is the value of aList after the following code is executed? alist = [1, 2, 3, 4, 5] alist.pop() alist.pop(3) aList.remove(2) aList.append(2) a. [1, 2, 4] b. [1, 3, 2] c. [2, 4,2] d. error 27) What values does counter variable i assume when this loop executes? for i in range(30, -10, -10): print(i, end = "") a. 30 20 10 0 -10 b. 30 20 10 0 c. 20 10 0 d. 30 20 10
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
For python,
25) What is the value of "c" after the following code executes?
a = [10, 50, 20]
b = [30, 60, 40]
c=b+a
a. [10, 20, 30, 40, 50, 60]
b. [10, 50, 20, 30, 60, 40]
C. [30, 60, 40, 10, 50, 20)
d. error
26)
What is the value of aList after the following code is executed?
alist = [1, 2, 3, 4, 5]
alist.pop()
alist.pop(3)
aList.remove(2)
aList.append(2)
a. [1, 2, 4]
b. [1, 3, 2]
c. [2, 4,2]
d. error
27)
What values does counter variable i assume when this loop executes?
for i in range(30, -10, -10):
print(i, end = "")
a. 30 20 10 0 -10
b. 30 20 10 0
c. 20 10 0
d. 30 20 10
Step by step
Solved in 3 steps