편집 기록

편집 기록
  • 프로필 nowp님의 편집
    날짜2023.12.11

    파이썬 random 오류


    from random import *
    
    a = random()
    print(a)
    

    파이썬에서 위와같이 작성한 코드가 아래와 같이 오류가 납니다. 왜 그런 것일까요?

    ----------------------------------------------------------------------------------------------------------------------------
    Traceback (most recent call last):
      File "C:\Users\user\Desktop\PythonWorkSpace\random.py", line 1, in <module>
        from random import *
      File "C:\Users\user\Desktop\PythonWorkSpace\random.py", line 3, in <module>
        a = random()
    NameError: name 'random' is not defined
    
  • 프로필 이태영님의 편집
    날짜2023.12.06

    파이썬 random 오류


    from random import *

    a = random() print(a)

    파이썬에서 위와같이 작성한 코드가 아래와 같이

    오류가 납니다. 왜 그런 것일까요?

    Traceback (most recent call last): File "C:\Users\user\Desktop\PythonWorkSpace\random.py", line 1, in from random import * File "C:\Users\user\Desktop\PythonWorkSpace\random.py", line 3, in a = random() NameError: name 'random' is not defined