Ad
  • 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

    should be good, now. Reset the trainer if you still encounter it.

  • Default User Avatar

    When running tests on Python 3.4.3 or 2.7.6 I pass the first test, then:

    "Traceback (most recent call last):
    File "main.py", line 23, in
    Test.expect(results1.connected(8,9),True , "Finds Valid Path")
    File "/runner/frameworks/python/cw-2.py", line 22, in expect
    display('FAILED', message)
    File "/runner/frameworks/python/cw-2.py", line 14, in display
    type.upper(), mode.upper(), label, format_message(message)))
    File "/runner/frameworks/python/cw-2.py", line 9, in format_message
    return message.replace("\n", "<:LF:>")
    AttributeError: 'bool' object has no attribute 'replace'"

  • 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

    EDIT: this happens using python 3.6
    some of the random test cases test numbers when they were not mentioned in the instructions.

    A word is a string of letters (A to Z) optionally containing one or more apostrophes (') in ASCII. (No need to handle fancy punctuation.)

     Frequencies of the most common words: [13, 25, 19] should equal [25, 25, 23]
    

    also, on the same note: The random test expect duplicate results

  • 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
  • Loading more items...