The equivalent function for the element selection operator is called [...] , and it also uses 0-indexed positions to select elements from a list.
Answer
getitem
Tags
#python #sicp
Question
The equivalent function for the element selection operator is called [...] , and it also uses 0-indexed positions to select elements from a list.
Answer
?
Tags
#python #sicp
Question
The equivalent function for the element selection operator is called [...] , and it also uses 0-indexed positions to select elements from a list.
Answer
getitem
If you want to change selection, open original toplevel document below and click on "Move attachment"
Parent (intermediate) annotation
Open it The equivalent function for the element selection operator is called getitem , and it also uses 0-indexed positions to select elements from a
list.
Original toplevel document
2.2 Data Abstraction exed, meaning that the index 0 selects the first element, index 1
selects the second, and so on. One intuition that supports this indexing
convention is that the index represents how far an element is offset from the
beginning of the list.
<span>The equivalent function for the element selection operator is called
getitem , and it also uses 0-indexed positions to select elements from a
list.
>>> from operator import getitem
>>> getitem(pair, 0)
10
>>> getitem(pair, 1)
20
Two-element lists are not the only method of representing pairs in Pyth
Summary
status
not learned
measured difficulty
37% [default]
last interval [days]
repetition number in this series
0
memorised on
scheduled repetition
scheduled repetition interval
last repetition or drill
Details
No repetitions
Discussion
Do you want to join discussion? Click here to log in or create user.