input: Write a python function to find the largest prime number less than a given number.
  assert largest_prime(100) == 97
  assert largest_prime(50) == 47
  assert largest_prime(10) == 7
output: def largest_prime(n):
      def is_prime(num):
          if num <= 1:
              return False
          for i in range(2, int(num**0.5) + 1):
              if num % i == 0:
                  return False
          return True
      
      for i in range(n - 1, 1, -1):
          if is_prime(i):
              return i