Question 1
Question
Slicing is used to extract a part of the list.
Question 2
Question
Single element is not treated as list.
Question 3
Question
List is enclosed in curly brackets.
Question 4
Question
Operator & concatenates one list to the end of other list.
Question 5
Question
Operator * repeats the content of a list by specified number of times.
Question 6
Question
Which of the following commands will create a list?
Answer
-
list1 = list()
-
list1 = []
-
list1 = list([1, 2, 3])
-
all of the mentioned
Question 7
Question
Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?
Answer
-
[2, 33, 222, 14]
-
Error
-
25
-
[25, 14, 222, 33, 2]
Question 8
Question
Suppose list1 is [1, 3, 2], What is list1 * 2?
Answer
-
[2, 6, 4]
-
[1, 3, 2, 1, 3]
-
[1, 3, 2, 1, 3, 2]
-
[1, 3, 2, 3, 2, 1]
Question 9
Question
What will be the output of the following Python code?
>>>"Welcome to Python".split()
Answer
-
[“Welcome”, “to”, “Python”]
-
(“Welcome”, “to”, “Python”)
-
{“Welcome”, “to”, “Python”}
-
“Welcome”, “to”, “Python”
Question 10
Question
To which of the following the “in” operator can be used to check if an item is in it?
Answer
-
Lists
-
Dictionary
-
Set
-
All of the mentioned