Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 16 Online
OpenStudy (anonymous):

Caesar Cipher problem. I spend almost 6 hours to code def build_decoder(shift): I am stuck. can anybody help me out?

OpenStudy (anonymous):

My code is here but still producing same thing as encoder UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ ' LOWER = 'abcdefghijklmnopqrstuvwxyz ' decoder = {} encoder = build_coder(shift).copy() for deUP in UPPER: decoder[deUP] = encoder.get(deUP) return decoder

OpenStudy (anonymous):

Hi, This is what I have for this code: decoder = {} encoder = build_encoder(shift) encoder_keys = encoder.keys() #This creates a list containing the keys in the encoder encoder_values = encoder.values() #This creates a list containing values in the encoder for i in range(len(encoder_keys)): decoder[encoder_values[i]] = encoder_keys[i] #switches the key value pairs return decoder Hope that makes sense.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!