Ad
  • Custom User Avatar

    Restrictions on some/all libraries is required in Python.

  • Custom User Avatar
    • description should be reworded, especially the part where each gift is raised to an exponent of two when calculating the score.
    • input type should be different, maybe in the form of a dictionary
    • fixed tests for handling ties
  • Custom User Avatar

    suggestion part:

    • the small random tests should come before the "not small random tests" (otherwise the user is still first facing a wall of text)
    • you should generalize the two batches of random tests, using a function and passing what changes between the small/not small batches as parameters of that function
    • leste = tuple(random.sample(words, random.randint(2, 6))) -> here, you could keep random.choices, because one person could offer the same gift several times
    • lst, lst2, leste, s, o, ... => choose more carefully your variable names. Moreover-and-above-all, don't ever name a variable with something that evokes something else than the actual type of the value. Typically, lst and alike are for lists, not tuples.
      • lst -> desired_gifts
      • lst2 -> offered_gifts
      • leste -> rnd_gifts
      • ii -> _ (because it's an unused variable)

    (I didn't take a look at the description yet)


    Issue part:

    The number of offered gifts (ie. the number of tuples given as arguments) must also be random. To accomodate this with the function calls, just replace func(lst, lst2[0], lst2[1], lst2[2], lst2[3], lst2[4], lst2[5], lst2[6], lst2[7], lst2[8], lst2[9]) with func(lst, *lst2) (but with proper variable names... ;) )