diff --git a/native-datatypes.html b/native-datatypes.html index 10781b4..deec0fc 100755 --- a/native-datatypes.html +++ b/native-datatypes.html @@ -711,7 +711,7 @@ KeyError: 21 File "<stdin>", line 1, in <module> KeyError: 'pop from an empty set'
    -
  1. The pop() method removes a single value from a set and returns the value. However, since sets are unordered, there is no “last” value in a set, so there is no way to control which value gets removed. It is essentially random. +
  2. The pop() method removes a single value from a set and returns the value. However, since sets are unordered, there is no “last” value in a set, so there is no way to control which value gets removed. It is completely arbitrary.
  3. The clear() method removes all values from a set, leaving you with an empty set. This is equivalent to a_set = set(), which would create a new empty set and overwrite the previous value of the a_set variable.
  4. Attempting to pop a value from an empty set will raise a KeyError exception.