Collections of data

6 important questions on Collections of data

Numbers = [10, 2, 1]
print(numbers[3])

Wat wordt er geprint?

Error. Posities 0 - 2 zijn er wel.

Waar komt hier het nieuwe element 4?
numbers = [111, 7, 2, 1]
numbers.append(4)

Achteraan: [111, 7, 2, 1, 4]

Waar komt hier het nieuwe element 4?
numbers = [111, 7, 2, 1]
numbers.insert(-1, 222)

[111, 7, 2, 222, 1]
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart


my_list = []


for i in range(3):
    my_list.insert(i-1,i + 1)


print(my_list)

Hoe zit dit rijtje eruit?

[2, 3, 1]

Wat wordt hier geprint?
my_list = [0, 3, 12, 8, 2]

print(5 in my_list)
print(5 not in my_list)
print(12 in my_list)

False
True
True


Wat wordt hier geprint?
my = [1,2,3,4]
print(my[-3:-2])

[2]

The question on the page originate from the summary of the following study material:

  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo