Help with moving an object in bge randomly via script?
Cause

I think you do not understand the concept of the BGE logic. In your Python code you describe the behavior within a single frame. This means it runs exactly once per game loop iteration.

Your loop will not executed "over time". It will run within one frame resulting in overriding the object location and printing to console 100 times. The effect is: 100 messages per frame and a waste of processing time (as only the last location change will be visible).

Solution

Design the code in a way that it describes ONE iteration rather than 100. Run the code when you want to change the location. This might be 


constantly (Always with true level triggering), 
at key press (keyboard sensor)
random interval (timer property + property sensor + random actuator)
...


here is a sample code - demo.py

import bge
import random

def setAtRandomPosition(): 
    if not allSensorsArePositive():
        return
    owner = bge.logic.getCurrentController().owner

    owner.localPosition.x = random.randint(-10, 10)
    owner.localPosition.y = random.randint(-10, 10)

def allSensorsArePositive():
    for sensor in bge.logic.getCurrentController().sensors:
        if not sensor.positive:
            return False
    return True


call it with Module mode: demo.setAtRandomPosition

I hard-coded the limits from -10 to +10. You see this code is very simple as you only care one frame. How you keep the object within the camera frustum is up to you.

Try this with an Always Sensor [True Level Triggering] Frequency: 20


or use the keyboard sensor to set a new position at each  press


I hope it helps you