K
K
kurle2021-09-18 18:03:05
Python
kurle, 2021-09-18 18:03:05

It gives an error AttributeError: module 'random' has no attribute 'randit' how to fix?

import random

number = random.randit(1,10)
for i in range(3):
a = int(input())
if a < number:
print("The hidden number is greater")
if a > number:
print("The hidden less than")
elif a == number:
print("You're out!")
break Traceback

error
(most recent call last):
File "C:\Users\521m\Desktop\pyth\a.py", line 3, in
number = random.randit(1,10)
AttributeError: module 'random' has no attribute 'randit'

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2021-09-18
@sergiks

randi n t

I
Insaf Fretch, 2021-09-18
@ishaimiev

import random

number =random.randint(1, 10)
for i in range(3):
  a = int(input())
  if a < number:
    print("Загаданное число больше")
  if a > number:
    print("Загаданное число меньше")
  elif a == number:
    print("Вы вин!")
    break

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question