input: Write a function to encrypt a text using Caesar Cipher.
  assert encrypt('Sentry is the best', 4) == 'Wirxvc mw xli fivx'
  assert encrypt('ABCxyz', 2) == 'CDEzab'
  assert encrypt('Hello World', 5) == 'Mjqqt Btwqi'
output: def encrypt(text, shift):
      encrypted_text = []
      for char in text:
          if char.isalpha():
              shift_base = ord('a') if char.islower() else ord('A')
              shifted_char = chr((ord(char) - shift_base + shift) % 26 + shift_base)
              encrypted_text.append(shifted_char)
          else:
              encrypted_text.append(char)
      return ''.join(encrypted_text)