Lists in Python

Beschreibung

Coding Python Quiz am Lists in Python, erstellt von PathaPadha Support am 26/10/2020.
PathaPadha Support
Quiz von PathaPadha Support, aktualisiert more than 1 year ago
PathaPadha Support
Erstellt von PathaPadha Support vor mehr als 4 Jahre
75
0
1 2 3 4 5 (0)

Zusammenfassung der Ressource

Frage 1

Frage
List is similar to Array in Python
Antworten
  • True
  • False

Frage 2

Frage
List is represented by
Antworten
  • [ ]
  • { }
  • ( )
  • " "

Frage 3

Frage
List can only hold similar data types.
Antworten
  • True
  • False

Frage 4

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

Frage 5

Frage
List index starts from 0
Antworten
  • True
  • False

Frage 6

Frage
What is the last index of a list ?
Antworten
  • size - 1
  • size
  • -1
  • 0

Frage 7

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

Frage 8

Frage
List = [1, 2, 3, 4, 5] List[-1] = ?
Antworten
  • 1
  • 2
  • 5
  • 4

Frage 9

Frage
List = [1,2,3,4] List[1:3] = ?
Antworten
  • [1,2,3]
  • [1,2]
  • [2,3]
  • [2,3,4]

Frage 10

Frage
What is the output of [0] * 4 ?
Antworten
  • [0, 0, 0, 0]
  • 0000
  • 0,0,0,0
  • [0][0][0][0]

Frage 11

Frage
List = [1,2,3,4] List[-1:-2] = ?
Antworten
  • [ ]
  • [4]
  • [4, 3]
  • Error

Frage 12

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

Frage 13

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

Frage 14

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

Frage 15

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

Frage 16

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

Frage 17

Frage
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 ?
Antworten
  • append()
  • extend()
  • insert()
  • add()

Frage 18

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

Frage 19

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

Frage 20

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

Frage 21

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

Frage 22

Frage
List_A = [1,2,3,4,5] sum(List_A[2:]) = ________ ?
Antworten
  • 12
  • 14
  • 7
  • 9
Zusammenfassung anzeigen Zusammenfassung ausblenden

0 Kommentare

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

ähnlicher Inhalt

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