Multiple Choice Questions -Lists

Description

Quiz on Multiple Choice Questions -Lists, created by Aparna Dhirde on 17/03/2020.
Aparna Dhirde
Quiz by Aparna Dhirde, updated more than 1 year ago
Aparna Dhirde
Created by Aparna Dhirde over 5 years ago
72
0
1 2 3 4 5 (0)

Resource summary

Question 1

Question
What is the output when we execute list(“hello”)?
Answer
  • [‘h’, ‘e’, ‘l’, ‘l’, ‘o’]
  • [‘hello’]
  • [‘llo’]
  • [‘olleh’]

Question 2

Question
Suppose listExample is [‘h’,’e’,’l’,’l’,’o’], what is len(listExample)?
Answer
  • 5
  • 4
  • none
  • error

Question 3

Question
Suppose list1 is [2445,133,12454,123], what is max(list1)?
Answer
  • 2445
  • 133
  • 12454
  • 123

Question 4

Question
Suppose list1 is [1, 5, 9], what is sum(list1)?
Answer
  • 1
  • 9
  • 15
  • error

Question 5

Question
Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?
Answer
  • error
  • none
  • 25
  • 2

Question 6

Question
To add a new element to a list we use which command?
Answer
  • list1.add(5)
  • list1.append(5)
  • list1.addLast(5)
  • list1.addEnd(5)

Question 7

Question
Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.reverse()?
Answer
  • [3, 4, 5, 20, 5, 25, 1, 3]
  • [1, 3, 3, 4, 5, 5, 20, 25]
  • [25, 20, 5, 5, 4, 3, 3, 1]
  • [3, 1, 25, 5, 20, 5, 4, 3]

Question 8

Question
Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.extend([34, 5])?
Answer
  • [3, 4, 5, 20, 5, 25, 1, 3, 34, 5]
  • [1, 3, 3, 4, 5, 5, 20, 25, 34, 5]
  • [25, 20, 5, 5, 4, 3, 3, 1, 34, 5]
  • [1, 3, 4, 5, 20, 5, 25, 3, 34, 5]

Question 9

Question
Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop(1)?
Answer
  • [3, 4, 5, 20, 5, 25, 1, 3]
  • [1, 3, 3, 4, 5, 5, 20, 25]
  • [3, 5, 20, 5, 25, 1, 3]
  • [1, 3, 4, 5, 20, 5, 25]

Question 10

Question
Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop()?
Answer
  • [3, 4, 5, 20, 5, 25, 1]
  • [1, 3, 3, 4, 5, 5, 20, 25]
  • [3, 5, 20, 5, 25, 1, 3]
  • [1, 3, 4, 5, 20, 5, 25]

Question 11

Question
What will be the output of the following Python code? >>>list("a#b#c#d".split('#'))
Answer
  • [‘a’, ‘b’, ‘c’, ‘d’]
  • [‘a b c d’]
  • [‘a#b#c#d’]
  • [‘abcd’]

Question 12

Question
What will be the output of the following Python code? list1 = [1, 2, 3, 4] list2 = [5, 6, 7, 8] print(len(list1 + list2))
Answer
  • 2
  • 4
  • 5
  • 8

Question 13

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
Show full summary Hide full summary

0 comments

There are no comments, be the first and leave one below:

Similar

Physics - Energy, Power & Work
dominique22
BIOLOGY B1 3
x_clairey_x
Chemistry Regents - Bonding Theories and Polar Bonds Notes
Ali Kane
Unit 1: Business Studies GCSE
Libby Rose
Of Mice and Men Characters - Key essay points
Lilac Potato
GCSE AQA Physics Unit 2 Flashcards
Gabi Germain
Animal Farm CONTEXT
Lydia Richards2113
Forces and motion
Catarina Borges
FV modules 1-4 infinitives- ENTER SPANISH
Pamela Dentler
The Skeleton and Muscles
james liew