No student devices needed. Know more
25 questions
Which of the following statement will create list?
a. L1=list( )
b. L1=[1,2,3,4]
c. Both of the above
d. None of the above
Write the output of the following code : list(“welcome”)
a. [‘w’, ‘e’, ‘l’, ‘c’, ‘o’, ‘m’, ‘e’]
b. (‘w’, ‘e’, ‘l’, ‘c’, ‘o’, ‘m’, ‘e’)
c. [‘welcome’]
d. None of the above
Write the output of the following code :
>>> L=[“Amit”,”Anita”,”Zee”,”Longest Word”]
>>> print(max(L))
a. Zee
b. Longest Word
c. Error
d. None of the above
Find out the output
a. Longest Word
b. Zee
c. Amit
d. Error
Find out the output
a. 15 9 1
b. Error
c. Max and Min are only for String Value
d. None of the above
what is the output
a. [6, 7, 8]
b. 6, 7, 8
c. Error
d. 6
Find the output
a. [‘c’ , ‘o’]
b. [‘c’ , ‘o’ , ‘m’]
c. (com)
d. Error
Find the output
a. ['Sumit',‘Naina’]
b. [a]
c. ['Sumit']
d. None of the above
Find out the output
a. [10, 6, 2]
b. [10, 7, 4]
c. Error
d. None of the above
Which command is used to add an element in List named L1
a. L1.add(4)
b. L1.append(4)
c. L1.new(4)
d. None of the above
Find out the output
a. Error
b. 10
c. 10.0
d. 4
Write the output of the following
a. [2, 4, 6, 8, 11]
b. [1, 2, 3, 4, 5.5, 1, 2, 3, 4, 5.5]
c. Error
d. None of the above
write the output of the above
a. [1, 2, 3, 4, [3, 4, 5, 6]]
b. [1, 2, 3, 4, 3, 4, 5, 6]
c. None
d. None of the above
del statement can delete the following from the List?
a. Single Element
b. Multiple Elements
c. All elements along with List object
d. All of the above
Find the output
['A', 2, 3, 4]
[1, 2, 3, 4]
['A', 2, 3, 4]
['A', 2, 3, 4]
[1, 2, 3, 4]
[1, 2, 3, 4]
Error
What type of error is returned by the following statement?
a. IndexError
b. TypeError
c. ValueError
d. None of the above
Result of list slice is also a list?(T/F)
True
False
What we call the operation which is used to extract particular range from a sequence.
a. Slicing
b. range
c. Indexing
d. Replication
Index of last element in list is n-1, where n is total number of elements.(T/F)
True
False
Which of the following is true about List data type in Python?
a. List is a Sequence data type
b. List is mutable
c. List can have elements of different data type
d. All of the above
ist and String are different
a. in reference to their indexing
b. in reference to data type of elements they contain
c. None of the above
d. Both of the above
Write the output of the following:
3
4
9
6
Write the output
3
4
5
6
Which of the following statement will return first element from right of list ‘L’?
a. L[0]
b. L[-1]
c. L[1]
d. None of the Above
If we try to concatenate a list with elements of some other data type, _____________ occurs.
a. SyntaxError
b. SyntaxError
c. TypeError
d. None of the above
Explore all questions with a free account