Does anyone have the answer(code) to Problem 3(multi-level encryption & decryption) from Problem set #4? I did not see that answer in the solutions file. Thanks.
hey a better way would be you write your own code and then if you face any problem put it here if you have already written then you may post your code here for discussion
Ok I tried to make an attempt at this problem (attached below). My answer is wrong. Can someone provide the correct code and/or evaluate my code. Thanks. http://pastebin.com/0Y67n61r
I did this problem for edX, which is based on the OCW version, but I don't seem to have a function "apply_shifts" I have "apply_shift" and "find_best_shift", but it didn't require tuples so it's hard for me to figure out how to make compare your code and mine.
actually i didn`t get what whole of your code meant but still i recommend that you have different functions one creating the dictionary with letter as key and shifted one{which you have already done as build_encoder (perhaps) other function of applying the shifts i.e apply_shifts i had followed this approach take some newstring then suppose you have to apply (3, 6) sought of thing newstring = pick upto 3rd letter the input text + shifted text for the rest try it by this approach if still there is any problem i will elaborate using my code Hope this helps
Thanks guys for the input. I just found my mistake. My new code works. My mistake was that in line 28 of the previous code I inputed "placeholder[key:]" whereas I should have used just "placeholder". I changed that variable name to new_shift in the code below. Placeholder was a terrible name for that variable. Cheers. http://pastebin.com/cuyib61q
Join our real-time social learning platform and learn together with your friends!