I have already looked at this thread Python Mastermind Game Troubles on your website but the question I am asking is slightly different as I have been given a different task
You just forgot to reset your numberswrong variable to zero :)
As a side note, to spot bugs, try to make your code simpler.
It you try to apply all this advices, you final code should look like this:
from random import randint
# Init variable
numbers = [randint(1, 9) for _ in range(4)]
num_tries = 0
guesses = None
# Loop while numbers and guesses are not the same.
while numbers != guesses:
# Ask user to guess the 4 values
guesses = [
int(input("guess the first number: ")),
int(input("guess the second number: ")),
int(input("guess the third number: ")),
int(input("guess the fourth number: "))
]
num_tries += 1
# Display message with number of right numbers.
num_right_numbers = len([1 for i in range(4) if numbers[i] == guesses[i]])
print 'You got {0} numbers right.'.format(num_right_numbers)
# User won, print message and quit.
print 'Well Done!'
print 'It took you {0} tries to guess the number!'.format(num_tries)