how to add set in python

how to add set in python

Anonymous
Not applicable
737 Views
1 Reply
Message 1 of 2

how to add set in python

Anonymous
Not applicable

I find a code as following in Python3

>>>basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
>>> print(basket)                      
{'orange', 'banana', 'pear', 'apple'}
>>> 'orange' in basket                 
True
>>> 'crabgrass' in basket
False
 
>>>
...
>>> a = set('abracadabra')
>>> b = set('alacazam')
>>> a                                  
{'a', 'r', 'b', 'c', 'd'}
>>> a - b                             
{'r', 'd', 'b'}
>>> a | b                              
{'a', 'c', 'r', 'd', 'b', 'm', 'z', 'l'}
>>> a & b                            
{'a', 'c'}
>>> a ^ b                             
{'r', 'd', 'b', 'm', 'z', 'l'}

So I have two question 

1. Could I run "set" code in fusion 360 api python?

2. could I add 3d points data in "set"? for example (x,y,z)

it's cool if you can give me some example   

0 Likes
738 Views
1 Reply
Reply (1)
Message 2 of 2

goyals
Autodesk
Autodesk

I am not sure whether python set function works with custom data types so it might not work for Fusion API data types as well like Vector3D, Point3D etc.



Shyam Goyal
Sr. Software Dev. Manager
0 Likes