input: Write a python function to encrypt a text using Caesar cipher method.
  assert encrypt("Hello", 5) == "Mjqqt"
  assert encrypt("abcXYZ", 2) == "cdeZAB"
  assert encrypt("Python", 3) == "Sbwkrq"
output: def encrypt(text, shift):
      result = ""
      for char in text:
          if char.isalpha():
              shift_base = ord('A') if char.isupper() else ord('a')
              result += chr((ord(char) - shift_base + shift) % 26 + shift_base)
          else:
              result += char
      return result