Building a Caesar Cypher

Struggling with step 4.. I can get the right answer I believe but the testing won’t accept my answer.. It seems like I am not writing the exact solution it wants me to.. I thought the solution was the important thing

alphabet = ‘abcdefghijklmnopqrstuvwxyz’

shift = 5

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

print(shifted_alphabet)

Hi there,

It looks like you may have changed the starting code in areas you were not asked to change, which will cause the tests to fail. Please click the reset button to restore the original code and try again.

image

Your concatenation is correct, but you changed the starting code, which will cause the tests to fail. Concatenate to the existing variable assignment and don’t change anything else, please.


In the future, if you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

Happy coding!

Thank you for letting me know that I am not losing my mind…

alphabet = ‘abcdefghijklmnopqrstuvwxyz’

shift = 5

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

print(shifted_alphabet)

Still not working, as a former teacher I am not sure about how i am learning to do right when the answer is correct but the program refuses to pass the code. Room for some slight deviation can improve both learning confidence and learning. The opposite will probably reverse progress

I don’t understand. Did you reset your code like the moderator just said? If you did, could you please post your updated code? Like that we could help you. It seems that you just quoted the code from your previous post.

As dhess explained it, the workshop system is a bit strict in the way that you cannot modify your previous code (even just add some newlines) because this will make the tests fail.

1 Like

does this make shifted_alphabet different from alphabet? or maybe they are the same? if they are the same you are doing something wrong

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.