input: Write a python function to implement a Caesar cipher that shifts characters by a given number.
  assert caesar_cipher("Hello World", 5) == "Mjqqt Btwqi"
  assert caesar_cipher("abc", 3) == "def"
  assert caesar_cipher("xyz", 2) == "zab"
  assert caesar_cipher("Python", 10) == "Zidryx"
  assert caesar_cipher("Caesar Cipher", 7) == "Jhlzhy Jpwoly"
output: def caesar_cipher(text, shift):
      result = []
      for char in text:
          if char.isalpha():
              shift_base = ord('A') if char.isupper() else ord('a')
              result.append(chr((ord(char) - shift_base + shift) % 26 + shift_base))
          else:
              result.append(char)
      return ''.join(result)