Python: Checking whether or not a variable is a int (using while loop)

use*_*960 2 python-3.x

just need a little help. Starting out doing python, trying to create a high score program and I want to say while score is not equal to an integer then ask user to input score.

For example (this doesn't work)

name = input("Please enter your name: ")
score = None
while score != int(score):
    score = input("Enter your score: ")
print("congratz it worked genius")
Run Code Online (Sandbox Code Playgroud)

thanks in advance

Nic*_*las 5

 while True:
    try:
        score = int(input("Enter your score: "))
        break
    except ValueError:
        print("Int, please.")
Run Code Online (Sandbox Code Playgroud)