For this problem, you will use the caesar4.py code from the Unit 2 deliverable. a. Instructions for
Question:
For this problem, you will use the caesar4.py code from the Unit 2 deliverable. a. Instructions for this problem:
i. The string that you are trying to encrypt is your full name (first name and last name). Do not insert a space between your first and last name.
ii. Use a shift value of 27.
b. Line 12 in the code ends with %26. Delete the %26 and run the code.
i. What is the output? Provide a screenshot.
c. Put the %26 back in the code at its correct place. Now run the code.
i. What is the output? Provide a screenshot
d. Is there a difference in the output between parts (b) and (c) of this code?
e. Based on your work above, what is the role of %26?
f. Eric Arthur Blair is famous for many things, one of which is writing 1984. He wrote under the pseudonym “George Orwell”
i. Encrypt this pseudonym with a shift value of 26. Document your output.
ii. Encrypt this pseudonym with a shift value of -26. Document your output.
iii. What can you tell about the output of parts (i) and (ii) above?
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
str_in = raw_input("Enter message, like EROMOSELEOMORODION: ")
shift = int(raw_input("Shift value, like 3: "))
n = len(str_in)
str_out = ""
for i in range(n):
c = str_in[i]
loc = alpha.find(c)
newloc = (loc + shift)%26
str_out += alpha[newloc]
print "Obfuscated version:", str_out.
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill