What this is doing is generating a random number in the desired range, and passing it to print. Then, the value returned by print is assigned to the name roll.
Well, what is the return value of print? print doesn’t actually return anything, which translates to returning the value None. It doesn’t attempt to return the value passed to it, or anything like that. So the above is equivalent to:
print(random.randint(1,20))
roll = None
Written that way, it’s obvious that roll is never going to compare equal to 20 or 1.
The correct solution is simple: assign the variable and do the printing separately. As in