input: Write a python function to implement a Caesar cipher.
  assert caesar_cipher("hello", 2) == "jgnnq"
  assert caesar_cipher("abc", 3) == "def"
  assert caesar_cipher("xyz", 1) == "yza"
output: def caesar_cipher(text, shift):
      result = ""
      for char in text:
          if char.isalpha():
              shift_base = ord('a') if char.islower() else ord('A')
              result += chr((ord(char) - shift_base + shift) % 26 + shift_base)
          else:
              result += char
      return result