Learn String Manipulation by Building a Cipher - Step 56

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

This is the function caesar called with the arguments text and shift

I get that part but this is what its asking. " This time, pass the text variable and the integer 13 as arguments."

I’m not sure I understand the misunderstanding. How did you pass text and shift? It works the same way

what this lesson is asking is - pass the function again " caesar(text, shift) " and then "This time, pass the text variable and the integer 13 as arguments. " the integer 13 is throwing me off.

You typed shift before. Type 13 instead

aaahh thanks. Appreciate you.

1 Like