Tell us what’s happening:
I am having a hard time understanding what the lesson is asking of me when its saying now pass the text variable along with integer 13 as an argument.
Your code so far
# User Editable Region
text = 'Hello Zaira'
shift = 3
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 = (index + offset) % len(alphabet)
encrypted_text += alphabet[new_index]
print('plain text:', message)
print('encrypted text:', encrypted_text)
caesar(text, shift)
caesar(text, shift,)
# User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:109.0) Gecko/20100101 Firefox/115.0
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 56