input: Write a function to determine if a given number is prime and then print all prime numbers up to a specified number using Python. The function should take an integer input `n` and print all prime numbers from 2 to `n`. If the input number is less than 2, the function should print a message stating that there are no prime numbers in that range.
  
  assert is_prime(5)==True
  assert is_prime(6)==False
  assert is_prime(7)==True
  assert is_prime(8)==False
  assert is_prime(2)==True
output: def is_prime(n):
      if n < 2:
          return False
      for i in range(2, int(n**0.5) + 1):
          if n % i == 0:
              return False
      return True