Jul-30-2017, 08:26 AM
mutable sequences have a method called pop that can be optionally given one argument to use as the index, else 0 is used. the indexed element of the mutable sequence is the return value and is removed from the sequence.
my suggestion is to make it work much like the same name method of a mapping/dictionary. allow a 2nd argument which will be the default value if the sequence is too short to be indexed by the given index. by using a 2nd argument, no exception is raised, and the 2nd argument, the default value, is returned, when the index value is >= the length of the sequence.
my suggestion is to make it work much like the same name method of a mapping/dictionary. allow a 2nd argument which will be the default value if the sequence is too short to be indexed by the given index. by using a 2nd argument, no exception is raised, and the 2nd argument, the default value, is returned, when the index value is >= the length of the sequence.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.