input: Write a function to perform Caesar cipher encryption with a given shift.
  assert caesar_encrypt("HELLO WORLD", 3) == "KHOOR ZRUOG"
  assert caesar_encrypt("python", 5) == "udymts"
  assert caesar_encrypt("Caesar Cipher", 2) == "Ecguct Ekrjgt"
output: def caesar_encrypt(text, shift):
      encrypted_text = []
      for char in text:
          if char.isalpha():
              shift_base = ord('A') if char.isupper() else ord('a')
              encrypted_char = chr((ord(char) - shift_base + shift) % 26 + shift_base)
              encrypted_text.append(encrypted_char)
          else:
              encrypted_text.append(char)
      return ''.join(encrypted_text)