Is there a better way to condense the while loop?
Miscellaneous notes:

you don't need a break after a return
you could (attempt to) return directly from the input; &quot;except&quot; will still catch and cycle errors
inputNumber() explicitly returns an integer; no need to cast again.
temp_range isn't really needed - you can just use max_range, no loss to readability.
no need to add one to max_range (in the validation loop) - randint() includes the top limit.
random_number is an unhelpful variable name - I've called this target
using inputNumber() for the guess also seems sensible.
guess should be checked against the inclusive range - min and max are possible values.
personally I think the temperature categories should reflect the size of the range, rather than the size of the chosen number... however
your calculation is wrong anyway; you are testing the difference between guess and target so you should test against the small fraction of target, not target reduced by a fraction (or should just check guess against the numbers you calculate).
the &quot;hot&quot; range (outside &quot;super hot&quot;) is actually smaller than the &quot;super hot&quot; range - I adjusted this out to 1/4 of target
after correction, there's a range that gets no message, which can be covered in an else clause. I reordered so all tests are for &quot;in this range&quot; and the else covers the &quot;cold&quot; option.

To condense the message selection, you could set up a list of boundaries changing from one condition to another, and step through (or search) to find the applicable message. However I'm not sure that's a lot clearer in this case.
With updates reflecting most of these:
import random
CHEATING = True

def inputNumber(message):
    while True:
        try:
            return int(input(message))
        except ValueError:
            print(&quot;Not an integer! Try again.&quot;)

#ranges must be integers
min_range = inputNumber(&quot;Please insert the min range: &quot;)
max_range = inputNumber(&quot;Please insert the max range: &quot;)

#max range must be bigger than min
while min_range &gt;= max_range:
    max_range = inputNumber(&quot;Please insert a max range which is bigger than min range!: &quot;)

target = random.randint(min_range, max_range)

guess = inputNumber(&quot;Please enter your guess: &quot;)
counter = 1;  # you guessed once already
while guess != target:  # 1 guess incorrect
    if CHEATING: print(f&quot;{target} is the random number&quot;)# to see for myself which is the random numb
    if min_range &lt;= guess &lt;= max_range:  # WITHIN THE RANGE
        if  -target / 12 &lt; guess-target &lt; target / 12:  # 3 super hot
            print(&quot;Please try again, you are super hot!&quot;)
        elif  -target / 4 &lt; guess-target &lt; target / 4:  # 3 hot
            print(&quot;Please try again, you are hot!&quot;)
        elif -target / 2 &lt; guess-target &lt; target / 2:   # a bit meh
            print(&quot;Not great, not terrible - please try again&quot;)
        else:                                           # 3 cold
            print(&quot;Please try again, you are cold!&quot;)

    else:  # OUTSIDE RANGE
        print(&quot;You are outside the range, try again!&quot;)
    guess = inputNumber(&quot;Next guess? &quot;)
    counter += 1
if guess == target:  # guess correct
    print(f&quot;Congratulations, you guessed correctly in {counter} tries!&quot;)```

PS: &quot;please criticize the hell out my work&quot; is an excellent attitude, if you have the fortitude for it, and a great way to learn.