input: Write a python function to implement a Caesar cipher with a given shift value.
  assert caesar("hello world", 3) == "khoor zruog"
  assert caesar("HELLO WORLD", 3) == "KHOOR ZRUOG"
  assert caesar("abc XYZ", 2) == "cde ZAB"
  assert caesar("abc XYZ", -2) == "yza VXY"
  assert caesar("Python 3.6!", 5) == "Udymts 3.6!"
output: def caesar(text, shift):
      def shift_char(c, shift):
          if c.isalpha():
              start = ord('A') if c.isupper() else ord('a')
              return chr((ord(c) - start + shift) % 26 + start)
          return c
      
      return ''.join(shift_char(c, shift) for c in text)