New Problem with Number

I can’t get except ValueError to work, for some dumb reason.

import random
def number_fcuk():
    right_answer = random.randint(1,10)
    close_enough = right_answer + 1 or right_answer - 1
    points = 0
    while True:
        if points == 10:
            print("alright, I don't need you anymore. Byeeeeee :D")
            break
        guess = int(input("Howdy :D Guess a number or you'll probably die :D Well, what're you waiting for?!:"))
        except ValueError:
            print("Learn to count next time. Later, loser.")
        if guess == right_answer:
            points += 1
            print("You actually got that right? I guess you aren't as stupid as I thought. Let's see if it's a lucky streak after all :D I think you have about ",(points),"points by now.")
            right_answer = random.randint(1,10)
        elif guess == close_enough:
               print("...you know what, you can have that one.")
               points += 0.5
               right_answer = random.randint(1,10)
        elif guess == 1 and right_answer != 1:
            print("That's one second of your meaningless life wasted :D")
        elif guess == 2 and right_answer != 2:
            print("Two? As in you wish you had two parents?")
        elif guess == 3 and right_answer != 3:
            print("Three? As in your three brain cells fighting for fifth place?")
        elif guess == 4 and right_answer != 4:
            print("Did you know a plane goes infinintely in four directions, and it never ends? But you will. And no one will shed a tear :D")
        elif guess == 5 and right_answer != 5:
            print("You couldn't count to five if I cut off your hand and shoved it in your face :D")
        elif guess == 6 and right_answer != 6:
            print("Don't you dare >:(")
        elif guess == 7 and right_answer != 7:
            print("Today isn't your lucky day. Then again, the day you were born and then on was about the same :D")
        elif guess == 8 and right_answer != 8:
            print("Hey, you just might find some spiders under your pillow. The you can count the legs as they infest your rotting corpse :D")
        elif guess == 9 and right_answer != 9:
            print("Nine is a nice number. It's the biggest in any digit. 9, 99, 999. Don't you long for that kind of power? To be better than everyone else? Too bad that'll never happen. For you :D")
        elif guess == 10 and right_answer != 10:
            print("Hey, if we put you at the end, it'll make a hundred. Then you'll finally be useful :D")
        
number_fcuk()

except requires a try before it to work.

try:
    <code to test>
except ValueError:

Note that the code in-between the try ... except has to be indented.

Prior to add new functionality to a script, it is sometime easier to test that functionality in a smaller script (stack trace…)

Would you explain what is the intention here (and expected result)?

It creates a value I like to call, close enough. If you guess a close enough value, you get half a point instead of a full point you would normally get from a perfect guess.

Let’s say the right answer is 4. What would you expect to happen if you print(close_enough) ?

either 5 or 3, I assume. It works well enough ingame

So, I checked again, and it only close enoughs 1 more than the answer, not 1 less. You were right.