Tell us what’s happening:
When I changed the shift to offset, it says there are more shifts to be changed to offset, but there actually is no more.
Your code so far
text = 'Hello Zaira'
shift = 3
# User Editable Region
def caesar(message, offset):
alphabet = 'abcdefghijklmnopqrstuvwxyz'
encrypted_text = ''
for char in message.lower():
if char == ' ':
encrypted_text += char
else:
index = alphabet.find(char)
new_index = (message + offset) % len(alphabet)
encrypted_text += alphabet[new_index]
print('plain text:', message)
print('encrypted text:', encrypted_text)
caesar()
# User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 54