-
Notifications
You must be signed in to change notification settings - Fork 0
Home
I have used this library numerous times for my own advanced computer science courses and math courses (I am a math and comsci major), especially for checking my work. All that's necessary to use it is invoking pip install SetCalcPy
(assuming Python is installed on your machine) and invoking
from SetCalcPy import Set
Then declare a set like so:
A = Set(1,2,3)
or
B = Set([1,2,3], 3)
for a nested set.
Once declared all sets can effectively be treated as numbers.
print(A + B)
displays the union of the two sets
print(A & B)
displays the intersections of the two sets
print(A.powerSet())
displays the power set of set A
print(A - B)
displays the set minus of A minus B
print(A.complement)
displays the complement of A with the input universe
print(A * B)
displays the cartesian product of the two sets