First I like to thank everyone that helped me with my work...
Please bear with me I don't know how to explain my problem.
Trying to get the random number to remain the same through out the length of the program. When the player guess the right number the player clicks on "Y" and the number should change. Cant get the number to change inside the loop. Outside the loop it changes every time a guess is made. I had a couple of while loops under the initial one but I opted for the if and elif.
import random
def main():
answer = 'y'
while answer == 'y' or answer == 'Y':
number = random.randint(1, 1000)
print 'I have a number between 1 and 1000'
print 'Can you guess the right number'
print number
guess = input('Enter your number')
if number > guess:
print "Too low. Guess again"
guess
elif number < guess:
print "Too high. Guess again"
guess
elif number == guess:
print 'You won!!!'
answer = raw_input("Do you want to play again? (Enter y for yes): ")
main()