Ad
  • Default User Avatar

    For some random tests, the expected length seems to be off by one?

    ['94366 - KzQgybHa - 51.7 43.2 56.2 36.9 46.0', '61746 - jnsGvIel - 53.4 59.2 14.0 34.4', '96362 - EDFTyzLS - 43.6 58.3 85.5', '34877 - yVLBMuTK - 59.0 25.0 60.1', '28164 - xtHvMYWi - 18.3 69.6 98.4 34.8', '29873 - DopOhJfi - 18.2 76.4 29.1 10.2', '67638 - nOXGIqOs - 55.0 89.0 82.6', '58755 - IlLRxYYZ - 94.6 79.2 40.5', '67638 - IETAxXyI - 13.1 83.4 73.2 87.4 13.3']

    The attempt length (9) does not equal the answer length (8)

    Yet, I'm pretty sure that the list has 9 inputs?

  • Custom User Avatar

    I don;t see it either now.

  • Custom User Avatar

    I don't see any colored text in the description.. perhaps this issue has already been fixed?

  • Custom User Avatar

    Hey I learned this today too! 3 years later though...

  • Custom User Avatar

    Thanks (◕﹏◕✿)

  • Custom User Avatar

    Great Kata! Hope to see it in approved

  • Default User Avatar

    looks good to me

  • Custom User Avatar

    got it

  • Default User Avatar

    I would still consider changing this:

    Random Test Case
    
    Log
    ['59306 - NlfzEhom - 68.9 92.8 22.8 97.0', '01815 - hJTbdHZK - 00.7 14.3 32.1 98.0 48.3', '61722 - VhFNAGqW - 64.5 24.6 49.5 89.9 93.4', '83273 - fNGmMGKm - 98.9 00.1 96.9 23.3 44.6', '27520 - MUgMUYio - 43.0 15.0 05.1']
    

    Remove the log, and add the message you are logging in the "it", so it's part of the test case.

  • Custom User Avatar

    Okay I believe I followed the proposed solution of "unique" scores by comparing the values formatted to one decimal points, if there are same values I create a new list for testing, else I continue.
    As for the i, I had it just for my logging purposes, so I removed it.
    Let me know if this satisfies the criteria that was originally posted.

  • Default User Avatar

    Also about the ordering, the problem is you get 58.21999999999999 while we get 58.22. If 2 students have silimar scores like this, your order might be student 1 -> student 2, while ours is student 2 -> student 1. A secondary key won't change this. The problem is how the mean gets calculated differs between your solution and ours, it's not clearly specififed how to get the mean, and the chosen implementation changes the outcome.

  • Default User Avatar
    @test.it('Random Test Case '+str(i))

    Not sure how relevant "i" is. Perhaps you can display "students" in the "it".

  • Custom User Avatar

    So I ran some tests, and it seems that there isn't secondary sorting based on id:

    Test Case: ['B000 - Bruce Wayne - 100', 'A000 - Alfred Pennyworth - 100', 'K000 - Kate Kane - 100']
    Attempt: [('B000', 100.0), ('A000', 100.0), ('K000', 100.0)]  | Desired Answer: [('A000', 100), ('B000', 100), ('K000', 100)]
    
    Test Case: ['100 - AaBb - 100', '990 - CcDd - 100', '555 - EeFf - 100', '90 - GgHh - 100', '9354 - IiJj - 100']
    Attempt: [('100', 100.0), ('990', 100.0), ('555', 100.0), ('90', 100.0), ('9354', 100.0)]  | Desired Answer: [('100', 100), ('555', 100), ('90', 100), ('9345', 100), ('990', 100)]
    

    If you want, I can add secondary sorting. As it is now, my solution (the attempt above) only sorts based on grade and keeps it in the same order rather than sorting based on alphanumerical characters in the id.

    As for the other notes you left, I believe I implemented them (I learned more stuff on test cases!).

    EDIT: I should have refreshed before submitting... whoops >u<

  • Default User Avatar

    Your proposed solution of "unique" scores seems the easier way out of this, without changing the spirit of the kata :)

  • Custom User Avatar

    yeah, that's another way. But there you find the need for the secondary key again, I believe.

  • Loading more items...