'random' has no attribute 'randint'

You have created a .py file called random and tried to import this module, but since modules are just .py files, the compiler thought your file was the module and did not find randint inside. You can fix this error by renaming the file.