Tell us what’s happening:
It says “You should rename all occurrences of text to message,” but there aren’t any ‘text’ left in the code. So why it isn’t pass?
Your code so far
# User Editable Region
def caesar(message, offset):
alphabet = 'abcdefghijklmnopqrstuvwxyz'
encrypted_message = ''
for char in message.lower():
if char == ' ':
encrypted_message += char
elif char in alphabet:
index = alphabet.find(char)
new_index = (index + offset) % len(alphabet)
encrypted_message += alphabet[new_index]
else:
encrypted_message += char
print('Plain message:', message)
print('Encrypted message:', encrypted_message)
message = "Hello Zaira"
offset = 3
caesar(message, offset)
# User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 54