Python | sympy.sets.open() method

With the help of sympy.sets.open() method, we can make a set of values by setting interval values like right open or left open that means a set has right open bracket and left open brackets by using sympy.sets.open() method.

Syntax : sympy.sets.open(val1, val2)
Return : Return set of values with right and left open set.

Example #1 :
In this example we can see that by using sympy.sets.open() method, we are able to find the set of values by defining right and left open brackets.



filter_none

edit
close

play_arrow

link
brightness_4
code

# import sympy
from sympy.sets import Interval
  
# Use sympy.sets.open() method
gfg = Interval.open(0, 10)
print(gfg)
    
print(gfg.contains(0))

chevron_right


Output :

(0, 10)
False

Example #2 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# import sympy
from sympy.sets import Interval
  
# Use sympy.sets.open() method
gfg = Interval.open(0, 5)
print(gfg)
    
print(gfg.contains(4))

chevron_right


(0, 5)
True



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.