Draft

Quadruple M

304 of 444Caders
Description
Loading description...
View
AllIssues6QuestionsSuggestions4Show Resolved
  • Please sign in or sign up to leave a comment.
  • JtateCC Avatar

    This doesn't seem different enough to what you would get in a basic tutorial.

  • user1430804 Avatar

    round(x,2) will work after trying multiple times.. :)

  • chris123450 Avatar

    This comment has been hidden.

  • ilya_plotnikov Avatar

    I don't get it, why the average of two middle items in this list[-1, 10, 2, 0] is 1 instead of 6?

  • mauro-1 Avatar

    In python the natural way to return multiple values is using a tuple, not a list.

  • mauro-1 Avatar

    Rounding prevents correct float comparision. Two similar values (within tolerance) may be rouded to different values.
    Floats should be compared with test.assert_approx_equals.

  • danielzaiser91 Avatar

    is this kata really in beta since over 4 years? Time to go out of Beta maybe? :D

    Also this line of the description should be rephrased:

    "med is the number in the middle when the list is sorted. Should the list have an even size, take the two numbers that are 'most' middle."

    "most middle" is confusing and should be something like "Should the list have an even size, return the average of the two middle values."

  • Voile Avatar

    This is not new. All 4 operations required already exists in many existing katas.

  • Fantomius Avatar

    This kata reminds me a joke:

    "On average, people are mean."

  • ZozoFouchtra Avatar
  • nbeck Avatar

    You can find my Ruby translation available here and my Crystal translation available here

    Please review and accept if everything is ok.

  • vpop Avatar

    Description says:

    if the list has an even amount of numbers, return the average of them for the median.

    It might be more clear to say:

    if the list has an even amount of numbers, return the average of the two numbers in the middle.

  • user7763760 Avatar

    in python 2.7.6: [993.03, 50.52, 531.15, 550.11] should equal [993.03, 50.519999999999996, 531.15, 550.11]

  • user2821739 Avatar

    There's a problem in the Python translation . All the items in the return list are supposed to be rounded upto 2 points . But error pops up in 3.4.3 when I try to round the min value ! Although it's a trivial bug but I think it should be fixed :)

  • kjmosher Avatar

    This comment has been hidden.

  • mstrfx Avatar

    [983.84, 34.5, 341.34000000000003, 445.85200000000003] should equal [983.84, 34.5, 341.34000000000003, 445.852]

    Does it work as intended? I would suggest adding some rounding.