I read about sets and see terms like "specific" elements and "arbitrary" elements. For example: "The remove method removes a specific element from the set, pop removes an arbitrary element." Can someone explain arbitrary elements?
ar · bi · trar · y is an ˈärbəˌtrerē/adjective based on a random choice or personal whim, and not on any reason or system.
ˈärbəˌtrerē/
In the context of your question, an “arbitrary element” simply means an element not selected by you. From the point of view of the program, the element was chosen randomly and unpredictably.
Consider:
x = set([1,2]).pop()
x 1 2, , .
x
1
2
.
remove .
. ,
, - , . X + X = 2X, X - , .
, , pop . nums = {4, 3, 3, 3, 3, 4, 5, 6, 1, -3} () nums.add(-7) nums.pop() ()
: {1, 3, 4, 5, 6, -3} {3, 4, 5, 6, -7, -3}
Source: https://habr.com/ru/post/1662563/More articles:ui-router 1.0.0 beta and nested permissions: how to rewrite - angularjsWhy are structures slower than classes? - c #How to have accents in my program (for example, é, è, à, á) - Python - pythonLocation swagger.json when creating with Swashbuckle - swaggerHow can I break the List into two lists, one of which contains all repeating values and the other is the remainder? - listIs it safe to store metadata up to the malloc'd string in C? - cЭффективное создание многомерного массива из списка строк, требующих .split(',') - pythonCreate two 2D numpy arrays from a list of strings - pythonКонфиденциальность пользователей Firebase - iosЗапрос с функцией в модели Flask-SQLAlchemy дает объекту BaseQuery не вызываемую ошибку - pythonAll Articles