Multiple Choice Questions -Lists

Beschreibung

Quiz am Multiple Choice Questions -Lists, erstellt von Aparna Dhirde am 17/03/2020.
Aparna Dhirde
Quiz von Aparna Dhirde, aktualisiert more than 1 year ago
Aparna Dhirde
Erstellt von Aparna Dhirde vor mehr als 5 Jahre
74
0
1 2 3 4 5 (0)

Zusammenfassung der Ressource

Frage 1

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

Frage 2

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

Frage 3

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

Frage 4

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

Frage 5

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

Frage 6

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

Frage 7

Frage
Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.reverse()?
Antworten
  • [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]

Frage 8

Frage
Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.extend([34, 5])?
Antworten
  • [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]

Frage 9

Frage
Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop(1)?
Antworten
  • [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]

Frage 10

Frage
Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop()?
Antworten
  • [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]

Frage 11

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

Frage 12

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

Frage 13

Frage
To which of the following the “in” operator can be used to check if an item is in it?
Antworten
  • Lists
  • Dictionary
  • Set
  • All of the mentioned
Zusammenfassung anzeigen Zusammenfassung ausblenden

0 Kommentare

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

ähnlicher Inhalt

Gemischte Klausur- und sonstige Fragen
Bibische
Nathan der Weise - Zusammenfassung
Laura Overhoff
Öffentliches Recht I -Teil 1
kicker03
Wortschatz Französisch 3. Gesundheit und Medizin
l_u_n_a_19
Euro-FH // Zusammenfassung PEPS2
Robert Paul
Themen der Vektorrechnung II
Paula Raithel
Chirurgie Kl. Wdk Vetie
Anne Käfer
Vetie Chirurgie 2018 Zweitklausur
Johanna Müller
Vetie Para 2015 Nachholprüfung
Larissa Görz
Vetie: Fleisch 2019 Matrikel 14
Johanna Tr