Why is ‘+’ not understood by Python sets?

Python sets don’t have an implementation for the + operator.

You can use | for set union and & for set intersection.

Sets do implement - as set difference. You can also use ^ for symmetric set difference (i.e., it will return a new set with only the objects that appear in one set but do not appear in both sets).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)