Λίστες

You got 14 of 14 possible points.
Your score: 100%
Question 1

τι θα γίνει;
p= ['PY', 'TH']
p[1]+='ON'
Score: 1 of 1
Your answerChoiceScoreCorrect answer
Selected

p= ['PY', 'THON']

1
Should have chosen

p= ['ON', 'PY', 'TH']

0

p= ['ONPY', 'TH']

0

p= ['PY', 'TH', 'ON']

0
Question 2

Τι θα εμφανιστεί;
a = ['Γεια', 'Hi', 'Ciao', ' Hola', 'Oi']
print len(a[1])
Score: 1 of 1
Your answerChoiceScoreCorrect answer
Selected

2

1
Should have chosen

12

0

11

0
Question 3

Τι θα κάνει η ενtολή a.append(5);
a = [10, 5, 4, 8, 12, 11]
a.append(5)
Score: 1 of 1
Your answerChoiceScoreCorrect answer

Δε θα κάνει τίποτα αφού ήδη το 5 υπάρχει στη λίστα και βρίσκεται στη θέση 1

0

θα διαγράψει το στοιχείο από την 5η θέση της λίστας

0
Selected

θα προσθέσει το 5 στο τέλος της λίστας

1
Should have chosen
Question 4

τι θα γίνει;
a=[9,10,11]
b=a.pop()
print b
Score: 1 of 1
Your answerChoiceScoreCorrect answer

Η λίστα θα γίνει a=[10, 11] και θα εμφανιστεί η τιμή 9

0

θα προστεθεί στο τέλος της λίστας ξανά το 11, δηλαδή  a=[9,10,11, 11] 

0

Η λίστα θα παραμείνει όπως είναι και θα εμφανιστεί η τιμή 11

0
Selected

Η λίστα θα γίνει a=[9,10] και θα εμφανιστεί η τιμή 11

1
Should have chosen
Question 5

a=['hi',7,10,20]
Για τη λίστα a, επιλέξτε την εντολή ώστε να τοποθετηθεί το 4 ανάμεσα στο 'hi' και στο 7
Score: 1 of 1
Your answerChoiceScoreCorrect answer

a.append(4)

0
Selected

a.insert(1, 4)

1
Should have chosen

a.pop(4,1)

0

a.insert(4, 1)

0
Question 6

τι θα γίνει;
a=[8,10,'hi']
a[3]=20
Score: 1 of 1
Your answerChoiceScoreCorrect answer
Selected

Συντακτικό σφάλμα: IndexError: list assignment index out of range

1
Should have chosen

a=[8,10, 20]

0

a=[8,10,'hi', 20]

0
Question 7

τι θα γίνει;
a = [4, 8, 12]
a =  [ a[0] * 4 ]  + a
Score: 1 of 1
Your answerChoiceScoreCorrect answer
Selected

a = [16, 4, 8, 12]

1
Should have chosen

Τίποτα, είναι συντακτικό σφάλμα

0

a = [4, 8, 12, 16]

0

a = [4, 8, 12, 4]

0
Question 8

τι θα γίνει;
a=[9]
a.pop()
a.pop()
Score: 1 of 1
Your answerChoiceScoreCorrect answer

Η λίστα θα μείνει κενή

0

Θα διαγραφεί η ίδια η λίστα

0
Selected

Η λίστα θα μείνει κενή και μετά Σφάλμα: IndexError: pop from empty list, δηλαδή δε μπορεί να γίνει διαγραφή από κενή λίστα

1
Should have chosen
Question 9

τι θα γίνει;
a=[10, 20, 28]
a.insert(len(a),5)
Score: 1 of 1
Your answerChoiceScoreCorrect answer

a=[10, 20, 5, 28]

0
Selected

a=[10, 20, 28, 5]

1
Should have chosen

Συντακτικό σφάλμα, αφού δεν υπάρχει η θέση 3

0
Question 10

L=[3, 5, 8, 13, 21, 34]

Τι θα εμφανίσει η εντολή: print L[0]

Score: 1 of 1
Your answerChoiceScoreCorrect answer
Selected

3

1
Should have chosen

0

0

34

0
Question 11

Τι θα εμφανιστεί;
a = [9, 8, 8.5, '11']
print type(a[2])
Score: 1 of 1
Your answerChoiceScoreCorrect answer
Selected

<type 'float'>

1
Should have chosen

<type 'list'>

0

<type 'int'>

0

<type 'str'>

0
Question 12

τι θα γίνει;
a = ['B', 'ΚΒ', 'MB', 'GB']
a = a + ['TB']
</python
Score: 1 of 1
Your answerChoiceScoreCorrect answer
Selected

a = ['B', 'ΚΒ', 'MB', 'GB', 'TB']

1
Should have chosen

a = ['B', 'ΚΒ', 'MB', 'GBΤΒ']

0

a = ['TB', 'B', 'ΚΒ', 'MB', 'GB']

0
Question 13

Τι θα γίνει;
a = [12, 16, 19]
a.insert(0,a[1]+4)
Score: 1 of 1
Your answerChoiceScoreCorrect answer
Selected

a = [20, 12, 16, 19]

1
Should have chosen

a = [12, 16, 19, 20]

0

a = [12, 20, 16, 19]

0
Question 14

Τι θα γίνει;
a=[5,9,12]
a.pop(-len(a))
Score: 1 of 1
Your answerChoiceScoreCorrect answer

Θα διαγραφεί το τελευταίο στοιχείο, το 12

0
Selected

Θα διαγραφεί το πρώτο στοιχείο, δηλαδή το 5

1
Should have chosen

Θα διαγραφεί το 9

0