## Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

### Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

# AttributeError: module 'random' has no attribute 'randint'

I ran this code here on TeamTreeHouse work-space few days ago and it was fine. Now I am getting this error:- "AttributeError: module 'random' has no attribute 'randint'
Why? Is this a teamtreehouse bug?

```import random

def game():

# generate random number between 1 & 20
secret_num = int(input("Enter a number between 1 & 20 for me to guess: "))

# computer guesses numbers to display to user
guess = random.randint(1, 20)
guesses = []

while len(guesses) < 5:

if guess==secret_num:
print("Ya'ay! I got it. The number is {}".format(secret_num))
break

elif guess!=secret_num:

# if it doesn't get correct answer in 1st attempt, it will ask for feedback
# type "l" if your secret_num is less than computer's guess
# type "h" if your secret_num is more than computer's guess

print("Is it lower than or higher than {}".format(guess))
user_input= input("")
if user_input=="l":
guess = random.randint(1, guess)
print(guess)
elif user_input=="h":
guess = random.randint(guess, 20)
print(guess)
guesses.append(guess)

else:
print("I lost. Your number was: {}".format(secret_num))
game()
```