NEW
Font size
WorksheetsRemoval - Part 2
Total questions: 20
Worksheet time: 19mins
If the array contains the following values:
num = [5, 7, 12, 15, 21, 25, 36, 39, 45, 48, 58, 61, 84, 87]
Question: What is the array size?
13
14
15
None of the choices
If the array contains the following values:
num = [5, 7, 12, 15, 21, 25, 36, 39, 45, 48, 58, 61, 84, 87]
Question: What is the last array index?
13
14
15
None of the choices
If the array contains the following values:
num = [5, 7, 12, 15, 21, 25, 36, 39, 45, 48, 58, 61, 84, 87]
Question: What is the first array index?
13
14
15
None of the choices
If the array contains the following values:
num = [5, 7, 12, 15, 21, 25, 36, 39, 45, 48, 58, 61, 84, 87]
Question: What value is stored in num[5]?
5
4
21
25
If the array contains the following values:
num = [5, 7, 12, 15, 21, 25, 36, 39, 45, 48, 58, 61, 84, 87]
Question: What value is stored in the first element?
5
7
21
25
If the array contains the following values:
num = [5, 7, 12, 15, 21, 25, 36, 39, 45, 48, 58, 61, 84, 87]
Question: What is the arrangement order of the numbers in the array?
mixed
increasing
decreasing
whole numbers
If the array contains the following values:
num = [5, 7, 12, 15, 21, 25, 36, 39, 45, 48, 58, 61, 84, 87]
Question: What are the indexes of the all numbers that are divisible by 5?
5, 15, 25, 45
0, 4, 6, 9
0, 3, 5, 8
1, 4, 6, 9
If the array contains the following values:
num = [5, 7, 12, 15, 21, 25, 36, 39, 45, 48, 58, 61, 84, 87]
Question: What are prime numbers in the array?
5, 7, 21
5, 7, 61
7, 21, 61
7, 61, 84
If the array contains the following values:
num = [5, 7, 12, 15, 21, 25, 36, 39, 45, 48, 58, 61, 84, 87]
Question: Which of the following statements will compute the sum of all the numbers in the array?
sum=index=0
while index < SIZE:
...sum = num[index]
...index = index + 1
sum=index=0
while index < SIZE:
...sum = num[index]
...index = + 1
sum=index=0
while index < SIZE:
...sum =+ num[index]
...index =+ 1
sum=index=0
while index < SIZE:
...sum += num[index]
...index = index + 1
If the array contains the following values:
num = [5, 7, 12, 15, 21, 25, 36, 39, 45, 48, 58, 61, 84, 87]
Question: Which of the following statements will display all the numbers in the array?
sum=index=0
while index < SIZE:
...print(num[index])
...index = index + 1
sum=index=0
while index < SIZE:
...print(num[SIZE])
...index = index + 1
sum=index=0
while index < SIZE:
...print(num[index])
...index = index
sum=index=0
while index < SIZE:
...print(num[index])
...index =+ 1
If the array contains the following values:
ch = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
Question: What is printed in this statement?
print (ch[0], ch[6])
AB
AF
AG
AC
If the array contains the following values:
ch = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
Question: What is printed in this statement?
print (ch[6], ch[7])
FG
GF
All letters
ERROR
If the array contains the following values:
ch = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
Question: What is printed in this statement?
print (ch[6], ch[7])
FG
GF
Mismatch error
Index error
If the array contains the following values:
ch = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
Question: Which of the following statements will swap the letters 'A' and 'B'?
temp=ch[0]
ch[0]=ch[1]
temp=ch[1]
temp=ch[0]
ch[0]=ch[1]
ch[1]=temp
temp=ch[1]
ch[0]=ch[1]
ch[1]=temp
temp=ch[2]
ch[0]=ch[1]
ch[1]=temp
If the array contains the following values:
ch = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
Question: Which of the following statements will copy the last letter to the first letter?
temp = ch[0]
ch[0] = temp
temp = ch[7]
ch[0] = temp
temp = ch[6]
ch[0] = temp
temp = ch[0]
ch[6] = temp
If the array contains the following values:
ch = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
Question: Which of the following statements will verify if the letters in the array are all capital letters?
if ch[index] >= 65 and ch[index] <=90:
if ch[index] > 'A' and ch[index] < 'Z':
if ch[index] >= 65 or ch[index] <=90:
if ch[index] > 'A' or ch[index] < 'Z':
If the array contains the following values:
ch = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
Question: Which of the following statements will verify if the letters in the array are all small letters?
if ch[index] > 97 and ch[index] < 122:
if ch[index] >= 'a' and ch[index] < 'z':
if ch[index] >= 97 or ch[index] <=122:
if ch[index] > 'a' or ch[index] < 'z':
If the array contains the following values:
ch = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
Question: Which of the following statements will update the third element to letter 'S'?
'S' = ch[3]
'S' = ch[2]
ch[2] = 'S'
ch[3] = 'S'
If the array contains the following values:
ch = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
Question: How can you display the letters in reverse order'?
index=0
while index<SIZE:
...print ch[index]
...index+=1
index=0
while index<SIZE:
...print ch[SIZE-index-1]
...index+=1
index=0
while index<SIZE:
...print ch[index]
...index=1
index=0
while index<SIZE:
...print ch[SIZE-index]
...index+=1
If the array contains the following values:
ch = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
Question: Which of the following statements will display the first three letters?
print (ch[0])
print (ch[0], ch[1])
print (ch[0], ch[1], ch[2])
print (ch[0], ch[1], ch[2], ch[3])
