Q:

Printing Prime Numbers within Boundries

I 'm trying to print out prime numbers in a range with bool structure.
def get_boundries_from_user():
    upper_boundary = input("Enter upper boundary please:\n")
    lower_boundary = input("Enter lower boundary please:\n")
    return upper_boundry,lower_boundary

def print_prime_numbers():
    upper_boundry,lower_boundry = get_boundries_from_user()
    upper_boundry += 1
    if (lower_boundary<0 or upper_boundary<0):
        print "Negative values cannot be prime numbers"
        return
    for i in range(lower_boundary,upper_boundary):
        prime = True
        for k in range(2,i):
            if (i%k==0):
                prime = False
                if prime:
                    print i

print_prime_numbers()

Where am I mistaken?Can you explain the logic of your answer along with it?

A:

def get_boundries_from_user():
    upper_boundary = input("Enter upper boundary please:\n")
    lower_boundary = input("Enter lower boundary please:\n")
    return upper_boundary,lower_boundary

def print_prime_numbers():
    upper_boundry,lower_boundry = get_boundries_from_user()
    if (lower_boundry<0 or upper_boundry<0):
        print "Negative values cannot be prime numbers"
        return
    print "\nPrimes"
    for i in range(lower_boundry,upper_boundry+1):
        prime = True
        for k in range(2,i):
            if (i%k==0):
                prime = False
        if prime:
            print i

print_prime_numbers()

Here is the working code. Please note, you must enter upper boundary first and then the lower boundary. So for e.g UB-20 and LB-10 will give you output 
Primes
11
13
17
19

