Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

Lists in Python

Description

Coding Python Quiz on Lists in Python, created by PathaPadha Support on 26/10/2020.
PathaPadha Support
Quiz by PathaPadha Support, updated more than 1 year ago
PathaPadha Support
Created by PathaPadha Support over 4 years ago
73
0
1 2 3 4 5 (0)

Resource summary

Question 1

Question
List is similar to Array in Python
Answer
  • True
  • False

Question 2

Question
List is represented by
Answer
  • [ ]
  • { }
  • ( )
  • " "

Question 3

Question
List can only hold similar data types.
Answer
  • True
  • False

Question 4

Question
Which is/are the correct ways to initialize a List ?
Answer
  • List = [ ]
  • List = list( )
  • List = { }
  • None of the given Options

Question 5

Question
List index starts from 0
Answer
  • True
  • False

Question 6

Question
What is the last index of a list ?
Answer
  • size - 1
  • size
  • -1
  • 0

Question 7

Question
Which method is used to enter element at last in a list ?
Answer
  • append( )
  • add( )
  • last( )
  • end( )

Question 8

Question
List = [1, 2, 3, 4, 5] List[-1] = ?
Answer
  • 1
  • 2
  • 5
  • 4

Question 9

Question
List = [1,2,3,4] List[1:3] = ?
Answer
  • [1,2,3]
  • [1,2]
  • [2,3]
  • [2,3,4]

Question 10

Question
What is the output of [0] * 4 ?
Answer
  • [0, 0, 0, 0]
  • 0000
  • 0,0,0,0
  • [0][0][0][0]

Question 11

Question
List = [1,2,3,4] List[-1:-2] = ?
Answer
  • [ ]
  • [4]
  • [4, 3]
  • Error

Question 12

Question
List = [12,,12,14,16,18, 20] List.count(12) + List.count(14) = ?
Answer
  • 2
  • 3
  • 1
  • Compilation Error

Question 13

Question
List = [1,2,3,4,5] List.index(2) = ?
Answer
  • 1
  • 2
  • Error
  • 3

Question 14

Question
List = [0,1,2,3,4,5] len(List) = ?
Answer
  • 5
  • 6
  • 4
  • Syntax error

Question 15

Question
List = [20,30,40,50] List.len()
Answer
  • 4
  • 5
  • 3
  • Error

Question 16

Question
List_A = [1,2,3,4,5] List_B = [6,7,8,9,11] max(List_A) + min(List_B) = ?
Answer
  • 11
  • 12
  • 10
  • Syntax Error

Question 17

Question
List_A = [1,2,3,4] List_B = [5,6,7,8] Which method is used to produce a new list, List_C = [1,2,3,4,5,6,7,8] , from List_A and List_B ?
Answer
  • append()
  • extend()
  • insert()
  • add()

Question 18

Question
List_A = [6,10,5,0,22] Which method will produce an output , [22,0,5,10,6] ?
Answer
  • sort()
  • reverse()
  • backwards()
  • change()

Question 19

Question
pop() method is used to pop a List Element from the end.
Answer
  • True
  • False

Question 20

Question
How to remove the first element from a List ?
Answer
  • remove()
  • pop()
  • pop(0)
  • discard(0)

Question 21

Question
Which word is used to Reverse a list using sort() in descending order ?
Answer
  • reverse
  • descending
  • backwards
  • Can't Reverse a List

Question 22

Question
List_A = [1,2,3,4,5] sum(List_A[2:]) = ________ ?
Answer
  • 12
  • 14
  • 7
  • 9
Show full summary Hide full summary

0 comments

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

Similar

Think Python
tsilvo2001
Basic Python - Print Formatting
Rebecca Noel
What is Python?
Daniel Ingram
Python
54671
Know your Python!
educ8ict
Basic Python - Strings
Rebecca Noel
Study on IoT systems design
Tomasz Cieplak
OpenSource Programming
Faheem Ahmed
Basic Python - Lists
Rebecca Noel
Python
Kirstie Wu