Tell us what’s happening:
my problem is that however i get the output it does not accept it
could anyone help me pls?
Your code so far
text = 'Hello Zaira'
shift = 3
# User Editable Region
def caesar(message, offset):
alphabet = 'abcdefghijklmnopqrstuvwxyz'
encrypted_text = ' '
for char in text.lower():
if char == ' ':
encrypted_text += char
else:
index = alphabet.find(char)
new_index = (index + offset) % len(alphabet)
encrypted_text += alphabet[new_index]
print('plain text:', message)
print('encrypted text:', encrypted_text)
caesar(text,shift)
# User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 54