I am new to python programming and I need help in finding numbers less than the number the user has entered with loops. How do I do that? : With this code, I only get to test if the number the user entered is prime or not. 
How do I add another loop to this code in order to find all the prime numbers less than or equal to the number the user has entered? 


    num = int(input("Enter a number: "))
       for x in range(1, num):
           if x > 1:
               prime = True
               for n in range(2, x):
                   if (x % n) == 0:
                       print ("Number", num, "is not prime")
                       break
           else:
               print("Number", num, "is prime")