anonymous
  • anonymous
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.
MIT 6.00 Intro Computer Science (OCW)
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this
and thousands of other questions

harsimran_hs4
  • harsimran_hs4
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
anonymous
  • anonymous
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
TuringTest
  • TuringTest
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.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

harsimran_hs4
  • harsimran_hs4
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
anonymous
  • anonymous
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
harsimran_hs4
  • harsimran_hs4
how about this one...much shorter tough http://pastebin.com/gicZ3qYc

Looking for something else?

Not the answer you are looking for? Search for more explanations.