Quiz
Multiple Choice Questions -Lists
Erstelle ein kostenloses Konto, um dieses Quiz zu beenden
Speichere deinen Fortschritt und sieh dir dein Endergebnis an.
oder mit deiner E-Mail registrieren
Schon ein Konto? Anmelden
Fragen in diesem Quiz (13)
1What is the output when we execute list(“hello”)?
- A[‘h’, ‘e’, ‘l’, ‘l’, ‘o’]
- B[‘hello’]
- C[‘llo’]
- D[‘olleh’]
2Suppose listExample is [‘h’,’e’,’l’,’l’,’o’], what is len(listExample)?
- A5
- B4
- Cnone
- Derror
3Suppose list1 is [2445,133,12454,123], what is max(list1)?
- A2445
- B133
- C12454
- D123
4Suppose list1 is [1, 5, 9], what is sum(list1)?
- A1
- B9
- C15
- Derror
5Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?
- Aerror
- Bnone
- C25
- D2
6To add a new element to a list we use which command?
- Alist1.add(5)
- Blist1.append(5)
- Clist1.addLast(5)
- Dlist1.addEnd(5)
7Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.reverse()?
- A[3, 4, 5, 20, 5, 25, 1, 3]
- B[1, 3, 3, 4, 5, 5, 20, 25]
- C[25, 20, 5, 5, 4, 3, 3, 1]
- D[3, 1, 25, 5, 20, 5, 4, 3]
8Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.extend([34, 5])?
- A[3, 4, 5, 20, 5, 25, 1, 3, 34, 5]
- B[1, 3, 3, 4, 5, 5, 20, 25, 34, 5]
- C[25, 20, 5, 5, 4, 3, 3, 1, 34, 5]
- D[1, 3, 4, 5, 20, 5, 25, 3, 34, 5]
9Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop(1)?
- A[3, 4, 5, 20, 5, 25, 1, 3]
- B[1, 3, 3, 4, 5, 5, 20, 25]
- C[3, 5, 20, 5, 25, 1, 3]
- D[1, 3, 4, 5, 20, 5, 25]
10Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop()?
- A[3, 4, 5, 20, 5, 25, 1]
- B[1, 3, 3, 4, 5, 5, 20, 25]
- C[3, 5, 20, 5, 25, 1, 3]
- D[1, 3, 4, 5, 20, 5, 25]
11What will be the output of the following Python code?
>>>list("a#b#c#d".split('#'))- A[‘a’, ‘b’, ‘c’, ‘d’]
- B[‘a b c d’]
- C[‘a#b#c#d’]
- D[‘abcd’]
12What will be the output of the following Python code?
list1 = [1, 2, 3, 4]
list2 = [5, 6, 7, 8]
print(len(list1 + list2))- A2
- B4
- C5
- D8
13To which of the following the “in” operator can be used to check if an item is in it?
- ALists
- BDictionary
- CSet
- DAll of the mentioned
Informationen
- Beschreibung
- Quiz am Multiple Choice Questions -Lists, erstellt von Aparna Dhirde am 17/03/2020.
- Autor
- Aparna Dhirde
- Sprache
- English
- Aufrufe
- 77
- Verlauf
- Erstellt am 17 Mär 2020 · aktualisiert am 17 Mär 2020
- Schlagwörter
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz
Mehr zu Python Lists and Data Structures