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

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. 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a You are encrypting your full name without a space and using a shift value of 27 b Removing the 26 ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!