title: How to set random locations to poly objects in Maya with Python?
body: <p>So here is my code:</p>
  
  <pre><code>import maya.cmds as mc
  import random
  
  x = random.random() * 10
  y = random.random() * 10
  z = random.random() * 10
  
  for i in range(5):
      mycube = mc.polyCube(h=3, w=3, d=3, n="Object#")
      mc.move(x, y, z, mycube)
  </code></pre>
  
  <p>Things should be clear what I am trying to do. I'm creating 5 <code>polyCube</code>'s and setting them random location in 3 dimensional world. My version of Maya is 2009 if it helps.</p>