파이썬 오류 질문 : AttributeError: module 'random' has no attribute 'randit'
조회수 2349회
파이썬 공부중에 이 오류가 계속 발생하는데 어덯게 해결하나요? 그리고 왜 이런 에러가 뜨는 건가요?
이거는 제가 입력한 코드입니다.
import random
for i in range(5):
print(random.randit(1, 10))
C:\Users\PycharmProjects\a\venv\Scripts\python.exe
C:/Users/PycharmProjects/a/sadfljksdfl.py
Traceback (most recent call last):
File "C:/Users/PycharmProjects/a/sadfljksdfl.py", line 3, in <module>
print(random.randit(1, 10))
AttributeError: module 'random' has no attribute 'randit'
Process finished with exit code 1
-
(•́ ✖ •̀)
알 수 없는 사용자 - 〉
1 답변
-
random.randint(1, 10)
으로 다시 해 보세요
int 를 it로 잘못 쓰셨어요
댓글 입력