A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • one year ago

6-00SC(2011) Problem#4 of Problem set 4. Hi. After two days of wrecking my brain I've come up with a partially correct (mostly incorrect) code. If anyone can describe what i'm doing wrong or can share the correct version, i'd greatly appreciate it. At this point all I want is to see the code work. The code is posted on the comment below

  • This Question is Open
  1. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I say partially correct because of the following output >>> s = apply_shifts("Do Androids Dream of Electric Sheep?", [(0,6), (3, 18), (12, 16)]) >>> s 'JufYkaolfapxQdrnzmasmRyrpfdvpmEurrb?' >>> shifts = find_best_shifts_rec(wordlist, s, 0) >>> shifts [(0, 6), [(3, 18), [(9, 16), [(6, 0), [(3, 0), None]]]]] the correct version should be giving me: [(0,6),(3,8),(12,16)]

    1 Attachment
  2. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    *the correct version should be giving me: [(0,6), (3,18), (12,16)]

  3. rsmith6559
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    First, is s correct after apply_shifts()? find_best_shifts is returning a list of tuple and list of tuple and list of tuple and list of tuple and list of tuple and None. So however you're iterating (iterating or recursion) at the top level has issues.

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

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

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.