Caesar Cipher problem. I spend almost 6 hours to code def build_decoder(shift): I am stuck. can anybody help me out?
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
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.
Join our real-time social learning platform and learn together with your friends!