2) Sets: numset = set(nums) = [1,2,3,5,6,7,8,9] (pruned duplicate elements, more efficient)
While you can generate a set from a list, a list cannot be an item in a set!
3) Dictionaries: numberNames = {1:'one', 2:'two', 3:'three', 'one':1, 'two':2, 'three':3};
(Mutable object, hashable. The keys do not all need to be the same type, the up dictionary mapped numbers to names, as well as names to numbers.)
Practice:
import maya.cmds;
loc = maya.cmds.spaceLocator()[0];
print(maya.cmds.xform(loc, q=True, rotateOrder=True));
RESULT:xyz
Very nice blog. Great to know about Container Types in India.
ReplyDelete