Here is the solution to Prime Numbers using functions in Python which is given below:
def primenumber(n):
primes = [ ]
for num in range(2, n + 1):
is_prime = True
for i in range(2, int(num ** 0.5) + 1):
if num % i == 0:
is_prime = False
break
if is_prime:
primes.append(num)
return primes
number = int(input("Enter range: "))
print(primenumber(number))