We value your privacy
This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content.
# Function to encode the text using Caesar cipher def caesar_cipher_encode(text, shift): result = "" # Iterate through each character in the text for char in text: # Check if the character is an uppercase letter if char.isupper(): # Apply the shift, keeping it within the range of uppercase letters (A-Z) result += chr((ord(char) + shift - 65) % 26 + 65) else: result += char # If not a letter, add the character unchanged return result # Text to be encoded text = "AIIA" # Defining the shift (can be any number, using 3 as an example) shift = 3 # Encoding the text encoded_text = caesar_cipher_encode(text, shift) # Displaying the encoded result print("Encoded text:", encoded_text)