"Number guessing game" in Python
Advice 1

I would not abuse the user with the question whether he wants to continue; just have a command (say, quit) for quitting the game while still guessing.

Advice 2

randomnumberguessinggame

The Python way is random_number_guessing_game.

Advice 3

You don't have to use parentheses in the branch and loop conditionals.

Summa summarum

I had this in mind:

import random


def main():
    actual_number = random.randrange(0, 1000)
    while True:
        guess = input("Enter your guess: ")

        if guess.strip().lower() == "quit":
            print("Bye!")
            return

        try:
            guess_number = int(guess)
        except ValueError:
            print(guess, "is not an integer!")
            continue

        if guess_number &lt; actual_number:
            print("Your guess is too small.")
        elif guess_number &gt; actual_number:
            print("Your guess is too large.")
        else:
            print(guess_number, "Excellent!")
            return

main()


Hope that helps.