It does not load the specific module of random when you run it as a .py. But if I load it in the python shell, I have no problems.
# -*- coding: utf-8 -*-
#
Change the file name of your code to "myrandom.py". And then run the program.
Update: Please don't name your Python source code file to standard modules. As it will cause error. Because right now instead of importing the standard library RANDOM of python, the python imports this random.py and which causes the error.
e.g. Do not give your python source code following names etc.:
You can try re-naming the file and try again