input: Write a python function to implement Caesar cipher encryption.
  assert caesar_encrypt('Python', 3) == 'Sbwkrq'
  assert caesar_encrypt('hello', 2) == 'jgnnq'
  assert caesar_encrypt('abcXYZ', 1) == 'bcdYZA'
  assert caesar_encrypt('Python is a programming language.', 3) == 'Sbwkrq lv d surjudpplqj odqjxdjh.'
output: def caesar_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