Build a Caesar Cipher - Step 4

Tell us what’s happening:

I am building the Caesar Cipher . I am using the example code and the Sentence[star:stop] suggestion also just to keep trying.
I need help.

Your code so far


# User Editable Region

alphabet = 'abcdefghijklmnopqrstuvwxyz'
shift = 5
shifted_alphabet = alphabet[shift:]
print(shifted_alphabet)
shifted_alphabet = 'alphabet[6:15]' + ' ' + 'alphabet[0:4]'

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0

Challenge Information:

Build a Caesar Cipher - Step 4

Hi @tsrha

For this step you need to modify the existing shifted_alphabet variable.

Carefully look at the example code to see what you need to do.

Please reset the step to restore the seed code and try again.

Happy coding

I tried cipher_alphabet instead, dropped the quotations, the numbers etc back and forth. Nothing works. help!

Hello @tsrha your code should look something like this if i remember. alphabet = ‘abcdefghijklmnopqrstuvwxyz’
shift = 5
shifted_alphabet = alphabet[shift:]
print(shifted_alphabet)

Hope to hear from you soon.

that variable is not accepted in this step, reset the step, and complete the line in which shifted_alphabet is created

i have below now . Does not pass

shifted_alphabet = alphabet[shift:] + alphabet[:shift]

please share all your code

alphabet = ‘abcdefghijklmnopqrstuvwxyz’

shift = 5

shifted_alphabet = alphabet[shift:]

print(shifted_alphabet)

shifted_alphabet = alphabet[shift:] + alphabet[:shift]

you have added a new line, that’s wrong, reset the step, complete the existing line

alphabet = ‘abcdefghijklmnopqrstuvwxyz’

shift = 5

shifted_alphabet = alphabet[shift:]

print(shifted_alphabet)

shifted_alphabet = ‘alphabet[6:26]’ + ’ ’ + ‘alphabet[0:5]’

This is the slicing according to the example code.

i have excluded the stops here

shifted_alphabet = ‘alphabet[6:25]’ + ’ ’ + ‘alphabet[0:4]’

Hi @tsrha

In one of the above posts containing only five lines of code, you have the correct line of code, but was placed on a new line. You are not asked to write a new line of code. You are asked to modify an existing expression.

Please reset the step to restore the seed code.

You will need to use the shift variable, do not hard code values.

Happy coding

Please tell me if this is above or below the print command

Thank you. Existing is the magic word!!!

1 Like