input: Write a python function to encrypt a given string using Caesar cipher with a given shift.
  assert encrypt('Hello, World!', 3) == 'Khoor, Zruog!'
  assert encrypt('abcXYZ', 2) == 'cdeZAB'
  assert encrypt('Python3.8', 5) == 'Udymts3.8'
output: def 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