# Encrypt uppercase characters if (char.isupper()): result += chr((ord(char) + shift - 65) % 26 + 65)