Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

tcc8m

  • 2 years ago

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.

  • This Question is Closed
  1. harsimran_hs4
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    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

  2. tcc8m
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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

  3. TuringTest
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  4. harsimran_hs4
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    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

  5. tcc8m
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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

  6. harsimran_hs4
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    how about this one...much shorter tough http://pastebin.com/gicZ3qYc

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

    Search OpenStudy
    • Attachments:

Ask your own question

Ask a Question
Find more explanations on OpenStudy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.