Random image positioning

How would I randomize the x and y values instead of having set coordinates? thanks!

    object = display.newImageRect(interfaceGroup,“1.png”,50,50)

    object.x = W1 / 2 

    object.y = H1 / 2

You can use the function, math.random

Eg.

object = display.newImageRect(interfaceGroup,“1.png”,50,50)

object.x = math.random( object.contentWidth/2, display.actualContentWidth - object.contentWidth/2 )

You can use the function, math.random

Eg.

object = display.newImageRect(interfaceGroup,“1.png”,50,50)

object.x = math.random( object.contentWidth/2, display.actualContentWidth - object.contentWidth/2 )