NEW
Font size
WorksheetsSAPET
Total questions: 20
Worksheet time: 20mins
Which of the following is considered a String value
500
false
“ SAPET ”
Yes
To initialize an instance of type ‘Expert’ ; the correct code is :
let expert=Expert()
var Expert()
Expert()=expert
dec expert=Expert
Which of the following is considered a Boolean value?
100
“Swift”
var
true or false
To insert number 10 at index 2 in score array; the correct command is :
insert(10,2)
score.insert(2,10)
score.insert(10)
score.insert(10, at:2)
Which of the below commands used to
delete the first element in the Array array ?
Array.remove(at:0)
Array (remove(0))
delete(at:0)
delete(0)
abc =[5 , 2 , 3]
The correct method to insert the values 8 at the end of the array is ?
abc.insert(4+4)
abc.append(8)
abc.insert(8)
abc.append(8,at: 2)
var list :[Int]= [ 3 , 2 , 4 , 6 , 8 , 10 ].
what is the range of index in the list array ?
0 to 5
1 to 5
0 t0 6
1 to 6
var list :[Int]= [ 3 , 2 , 4 , 6 , 8 , 10 ].
what is the value of the index 2 in the list array ?
2
4
6
8
To insert the letter "B" at index 2 in letter array; the correct command is :
insert("B",2)
letter.add(2,"B")
letter.insert("B")
letter.insert("B", at:2)
Which of the below commands used to
delete the third element in the number array ?
number.remove(at:2)
number (remove(2))
number.remove(at:3)
number (remove(3))
letter =["A" , "B" , "C", "D"]
The correct method to insert the letter "Y" at the end of the array is ?
letter.insert("Y")
letter.append("Y")
letter.insert("Y")
letter.append("Y",at: 3)
var list :[Int]= [ 3 , 2 , 4 , 6 ].
what is the range of index in the list array ?
0 to 3
1 to 3
0 t0 4
1 to 4
var list :[Int]= [ 3 , 2 , 4 , 6 ].
How many elements in the list array ?
3
4
5
6
var list :[Int]= [ 3 , 2 , 4 , 6 , 8 , 10 ].
what is the index of the element (6)in the list array ?
2
3
4
6
var list :[Int]= [ 3 , 2 , 4 , 6 , 8 , 10 ].
what is the data type of the list array ?
float
integer
Boolean
String
abc =[40 , 50 , 10]
What is the final output of the array after executing the following command
abc.append(50) ?
[50 , 40 , 50 , 10]
[40 , 50 , 10 , 50]
[40 , 10]
[40 , 50 , 50 ,10]
abc =[40 , 50 , 10]
What is the final output of the array after executing the following command
abc.insert("50", at:2) ?
[50 , 40 , 50 , 10]
[40 , 50 , 10 , 50]
[40 , 10]
[40 , 50 , 50 ,10]
abc =[40 , 50 , 10]
What is the final output of the array after executing the following command
abc.remove(at:1) ?
[50 , 40 , 50 , 10]
[40 , 50 , 10 , 50]
[40 , 10]
[40 , 50 , 50 ,10]
A collection that stores an ordered list of items.
Array
Function
Bolean
loop
The number that represents the position of an item in an array.
String
Function
Bolean
Index
