Skip to content

added submission for jlwatson #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

added submission for jlwatson #14

wants to merge 1 commit into from

Conversation

skleung
Copy link
Contributor

@skleung skleung commented Oct 13, 2015

No description provided.

# base for character shifts
ascii_base = ord('A')
# map comprehension for caesar cipher character encryption
caesar_encryption_mapping = {chr(c): chr(ascii_base + ((c - ascii_base + 3) % 26)) for c in range(ascii_base, ascii_base + 26)}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! Would be nice to factor out 3 and 26. I also think it would've been a little cleaner to use string's native ascii_uppercase property (it just spits out all of the uppercase characters)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant