Ad
  • Custom User Avatar

    I changed (again) the way the assertions are made, hopefully providing a better feedback, now (reset the trainer if you don't see any difference)

  • Custom User Avatar

    yeah, I feared a bit about that type of cases, where the message becomes a bit misleading... The problem is that the real count is:

    ("'vxn", 10)
    ('ansace', 12)
    ("das'", 20)      <<<< you're returning "das" instead, which isn't present in the count so has a 0 frequency.
    ("dtqo'a", 15)
    ('fhuubd', 3)
    ('lunceifkq', 2)
    ('yyaqfy', 24)
    
  • Custom User Avatar

    yyAQfy;DAS'!ANSAce.DTQO'A.; -DTQO'A?yyAQfy/?ANSAce-/,-?DAS'.?-.yyAQfy,?-/:'vxN.DAS',!!luNCEIFKq, -ANSAce:yyAQfy; luNCEIFKq_-?DAS'-.:!yyAQfy:DTQO'A!yyAQfy-,!'vxN;DAS'.DAS',,ANSAce:.DAS'/;DAS':? -:yyAQfy/- ?/DAS' ;?/DAS';:'vxN,DTQO'A-?ANSAce/,ANSAce.? DAS'?DTQO'A.DAS':;,! ANSAce;yyAQfy- -:,DAS'?_yyAQfy;'vxN//!yyAQfy ;??!DTQO'A-!.fhUUbD/;DAS':DTQO'A;:DTQO'A/-DTQO'A:yyAQfy?'vxN:.;/:'vxN,'vxN-,yyAQfy!-yyAQfy-DAS';?DAS' :'vxN, ! yyAQfy:.-/'vxN.,?-/fhUUbD,..DAS': ;DTQO'A;;yyAQfy?!? .DTQO'A:!!?ANSAce;?:yyAQfy..!yyAQfy:?.-DAS' :.?ANSAce.fhUUbD,/!/ANSAce;.:.yyAQfy ./ANSAce - !;ANSAce.!.:yyAQfy!yyAQfy;.DAS'. :DTQO'A;.;DTQO'A.DTQO'A?!.!.yyAQfy.yyAQfy?,DAS':_DTQO'A _.,yyAQfy_yyAQfy?'vxN?!:
    {'yyaqfy': 24, 'das': 20, 'ansace': 12, "dtqo'a": 15, 'vxn': 10, 'lunceifkq': 2, 'fhuubd': 3}
    [(24, 'yyaqfy'), (20, 'das'), (15, "dtqo'a")]
    ['yyaqfy', 'das', "dtqo'a"]
    Frequencies of the most common words: [24, 0, 15] should equal [24, 20, 15]

  • Custom User Avatar

    I have:
    [(25, "yowr'fr"), (17, 'zxytghkac'), (16, 'unleqfxsu')]

    My final return will give the strings like this:
    ["yowr'fr", 'zxytghkac', 'unleqfxsu']

    When it is tested for the numbers, it looks up "yow'fr" which gives the value 0. This makes the test attempt give a [0,17,16] expected [25,17,16]
    I cannot change yowr'fr in any way because it has an apostrophe in the middle. Is this an issue?

    The sample gives ("//wont won't won't") and I got ["won't", 'wont'] so when the string "won't" is given, wouldn't that give a 0 as well?

  • Custom User Avatar

    IIRC the strings should be split like "sie@##@1/1/1fsefsef" == ["sie", "fsefsef"], so no, you're wrong.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    yes, I handled that case as you described it

  • Custom User Avatar

    you don't have to "filter out", you have to "extract" the words:

    " //wont won't won't " => ["wont", "won't", "won't"] extracted, so ["won't", "wont"] as an output

  • Custom User Avatar

    then based on this sample test:

    Test.assert_equals(top_3_words(" //wont won't won't "), ["won't", "wont"])

    are we not required to filter out characters that are from A-Z or (')?

  • Custom User Avatar

    invalid issue:

    • without the actual input and your output, it's impossible to tell if that's an issue in the tests or if your code is just wrong.
    • language?

    for instance, those values are the frequencies of occurences of different words. So [25,25,23] means that there are 2 different words that occur 25 times and another that occur 23 times. While your ouput matches words that do not occur the right amont of times. I'd bet on your code not cutting the sentence correctly.

  • Custom User Avatar

    Frequencies of the returned words are compared to the frequencies of the expected words - I don't see any issue.

  • Custom User Avatar

    oh, right.

    Tho, the version shouldn't have been available. I guess it was a "reset the trainer" thing again.

  • Custom User Avatar

    Because from random import choices. For some reason 3.4 was available for me earlier...

  • Custom User Avatar
  • Custom User Avatar

    Python 3.6 should be made the only language version.

  • Loading more items...