(self, seq)
return seq[i]
Choose a random element from a non-empty sequence.
Choose a random element from a non-empty sequence.
Choose a random element from a non - empty sequence .
def choice(self, seq):
        """Choose a random element from a non-empty sequence."""
        try:
            i = self._randbelow(len(seq))
        except ValueError:
            raise IndexError('Cannot choose from an empty sequence')
        return seq[i]
def choice ( self , seq ) : try : i = self . _randbelow ( len ( seq ) ) except ValueError : raise IndexError ( 'Cannot choose from an empty sequence' ) return seq [ i ]