a) [2, 33, 222, 14] b) Error c) 25 d) [25, 14, ...
View QuestionSuppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?
a) Error b) none c) 25 d) 2 Answer: ...
View QuestionSuppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation?
a) print(list1[2:]) b) print(list1[:2]) c) print(list1[:-2]) d) ...
View QuestionTo shuffle the list(say list1) what function do we use?
a) list1.shuffle() b) shuffle(list1) c) random.shuffle(list1) d) random.shuffleList(list1) Answer: c Explanation: Execute ...
View QuestionSuppose list1 is [2445,133,12454,123], what is max(list1)?
a) 2445 b) 133 c) 12454 d) 123
View QuestionSuppose listExample is [‘h’,’e’,’l’,’l’,’o’], what is len(listExample)?
Suppose listExample is [‘h’,’e’,’l’,’l’,’o’], what is len(listExample)? a) 5 b) ...
View QuestionWhat is the output when we execute list(“hello”)?
a) [‘h’, ‘e’, ‘l’, ‘l’, ‘o’] b) [‘hello’] c) [‘llo’] d) ...
View QuestionWhich of the following commands will create a list?
a) list1 = list() b) list1 = [] c) ...
View Question