the body of the while loop is defined indented below the while keyword.
So you most likely want to change one of the two numbers in the while body.
so either
while num > random:
number=int(input("Please choose a number (1-10): "))
or
while num > random_num:
random_num=random.randint(1,5)
Note that you are overwriting the random package by naming a variable random, which is something you almost never want.
You also should try to import only at the top of a file:
Should import statements always be at the top of a module?
edit: full code:
import random
random_num=random.randint(1,5)
number=int(input("Please choose a number (1-10): "))
while number > random_num
print(number ,random_num)
number=int(input("Please choose a number (1-10): "))
# now the number is <= random_num