I started learning python. I wrote a very simple program.
#!/usr/bin/env python import random x = random.uniform(-1, 1) print str(x)
I run this from the command line.
python random.py
He returned with an error:
Traceback (most recent call last): File "random.py", line 2, in <module> import random File "D:\python practise\random.py", line 3, in <module> x = random.uniform(-1, 1) AttributeError: 'module' object has no attribute 'uniform'
This is a very simple program, I canβt understand what mistake I made in this. Can someone help me with this? Thanks in advance. (operating system: Windows 7, python version: 2.7)
narayanpatra
source share