-
Notifications
You must be signed in to change notification settings - Fork 0
Week 1 03 27
fengttt edited this page Mar 28, 2020
·
3 revisions
- Review homework
- test
- list and index
- rot13
- Add/finish the sumeven function in your toy library.
- Now you have a rot13c and rot13 functions. How do you rotate by 4 instead of 13? Write two functions,
def rotnc(n, c):
''' rotate c by n, where n is a number between 0 and 25 '''
# Your code here, return the char
def rotns(n, s):
''' return a string, with each character in s rotated by n '''
- If you encrypt a message with rotns(4, s), how do you decrypt the message?
- I have a message, encrypted with rotns, but I forgot my n (which sometime is called the key to the encryption). Here is my encrypted message
Pfl tre xvk zk zw pfl ivrccp nrek, slk pfl dljk kip, kip reu kip!
What did I say?