I am a beginner to Python and am just trying to make a simple 'Guess the number' game. I programmed it to tell you weather the number you guessed is higher or lower than the actual number. However, the 'Higher' and 'Lower' appear on the screen a couple of hundred times instead of just one.
Code:
import random
print('Welcome to Guess the Number')
print('Try to guess the number in as few tries as possible')
AttributeError: 'module' object has no attribute 'randit'
Code:
import random
print('Welcome to Guess the Number')
print('Try to guess the number in as few tries as possible')
the_number= random.randit(1, 100)
guess=int(input('Take a guess! '))
tries=1
while guess != nbum:
if guess>the_number:
print('Lower... ')
else:
print('Higher...
Leave a comment: