Lists in Python

Descrição

Coding Python Quiz sobre Lists in Python, criado por PathaPadha Support em 26-10-2020.
PathaPadha Support
Quiz por PathaPadha Support, atualizado more than 1 year ago
PathaPadha Support
Criado por PathaPadha Support mais de 4 anos atrás
76
0
1 2 3 4 5 (0)

Resumo de Recurso

Questão 1

Questão
List is similar to Array in Python
Responda
  • True
  • False

Questão 2

Questão
List is represented by
Responda
  • [ ]
  • { }
  • ( )
  • " "

Questão 3

Questão
List can only hold similar data types.
Responda
  • True
  • False

Questão 4

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

Questão 5

Questão
List index starts from 0
Responda
  • True
  • False

Questão 6

Questão
What is the last index of a list ?
Responda
  • size - 1
  • size
  • -1
  • 0

Questão 7

Questão
Which method is used to enter element at last in a list ?
Responda
  • append( )
  • add( )
  • last( )
  • end( )

Questão 8

Questão
List = [1, 2, 3, 4, 5] List[-1] = ?
Responda
  • 1
  • 2
  • 5
  • 4

Questão 9

Questão
List = [1,2,3,4] List[1:3] = ?
Responda
  • [1,2,3]
  • [1,2]
  • [2,3]
  • [2,3,4]

Questão 10

Questão
What is the output of [0] * 4 ?
Responda
  • [0, 0, 0, 0]
  • 0000
  • 0,0,0,0
  • [0][0][0][0]

Questão 11

Questão
List = [1,2,3,4] List[-1:-2] = ?
Responda
  • [ ]
  • [4]
  • [4, 3]
  • Error

Questão 12

Questão
List = [12,,12,14,16,18, 20] List.count(12) + List.count(14) = ?
Responda
  • 2
  • 3
  • 1
  • Compilation Error

Questão 13

Questão
List = [1,2,3,4,5] List.index(2) = ?
Responda
  • 1
  • 2
  • Error
  • 3

Questão 14

Questão
List = [0,1,2,3,4,5] len(List) = ?
Responda
  • 5
  • 6
  • 4
  • Syntax error

Questão 15

Questão
List = [20,30,40,50] List.len()
Responda
  • 4
  • 5
  • 3
  • Error

Questão 16

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

Questão 17

Questão
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 ?
Responda
  • append()
  • extend()
  • insert()
  • add()

Questão 18

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

Questão 19

Questão
pop() method is used to pop a List Element from the end.
Responda
  • True
  • False

Questão 20

Questão
How to remove the first element from a List ?
Responda
  • remove()
  • pop()
  • pop(0)
  • discard(0)

Questão 21

Questão
Which word is used to Reverse a list using sort() in descending order ?
Responda
  • reverse
  • descending
  • backwards
  • Can't Reverse a List

Questão 22

Questão
List_A = [1,2,3,4,5] sum(List_A[2:]) = ________ ?
Responda
  • 12
  • 14
  • 7
  • 9

0 comentários

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

Semelhante

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