Retired

Will the Pandemic Ever End ? (retired)

Description
Loading description...
Puzzles
Mathematics
Algorithms
  • Please sign in or sign up to leave a comment.
  • Ondris Avatar

    This comment has been hidden.

  • NikCSharp Avatar

    Description should reflect that if new_cases is equal to recovery, then it should return "It will never end!", as this is tested for in the tests.

    • Kees de Vreugd Avatar

      Or allow the warrior to use his/her brain and just ask to return 'It will never end!' if based on the input the pandemic ... well, will never end. You don't need to be a rocket scientist to figure that one out.

    • NikCSharp Avatar

      This is a beginner kata, it's better to have the instructions clearly defined in the description, with little room for mistake.

      Besides, there's no harm in adding something to the description.

  • Insisted Avatar

    You should use proper markdown just cause the examples are language specific. Else you should make it language agnostic

  • WestwardLand968 Avatar

    Basic manipulation of numbers is not a novel idea.

    • Kees de Vreugd Avatar

      It's not, but for an 8 it's okay. Those are real training kata's and training comes with repetition. Not really an issue, imho.

    • WestwardLand968 Avatar

      IMO we should look at how many 8/7 katas we have already, do we really need more?

    • jhoffner Avatar

      Basic manipulation of numbers is not a novel idea

      This statement could be assumed to mean "all math equations are manipulation of numbers, therefore we only need a few different math equations on this site". No?

      I'm not sure if this exact equation has been done on the site before, but unless it has in this exact configuration with a similar problem setup, I don't see this as an issue.

      Issue marked resolved by jhoffner 3 years ago
  • WestwardLand968 Avatar

    Returning multiple data types is bad practice.

    • user1430804 Avatar

      A little bit surprised by this issue. There are hundreds of katas returning multiple data types with same function. I think it's the beauty of Python and makes it unique from other languages like C++ that you can return multiple datatypes as per your function requirements.

    • B1ts Avatar

      The standarts for this on CW were much lower before. Different outputs make it impossible / complicated to translate your kata to languages that aren't loosely typed, which could be treated as an issue.

    • jhoffner Avatar

      I agree that this is an issue. Yes Python is cool and can return multiple data types, but this isn't a case where you would need to return multiple data types as a good example. Its just being done so that the kata has some more personality.

      Which is cool to have personality, but many users on this site are learning and its best to not confuse them into thinking this sort of function design is good practice.

      Two options to fix:

      1. Return -1 instead of the string
      2. Leave the string as is, but update the comments to include a tip that this kata is for fun, and it shows how python can return multiple data types, but that its actually not a good idea to return multiple data types from the same method. This way learners actually get a bit of of a mini-lesson.

      And yes other kata have this issue, that needs to be fixed.

  • anter69 Avatar

    What about recovers == new_cases? "It will never end!" (I guess :) --> it should be tested

  • AveragePythonEnjoyer Avatar

    Nice simple kata. Btw great idea of including time calculations in the tests.

    As for me, it seems that it will be better if time format was something like 'Awesome! You did it in {:6f} seconds'.format(perf_counter() - tic)

  • ejini战神 Avatar

    Missing corresponding imports in sample tests

  • ejini战神 Avatar

    I like your idea of including the time complexity calculation in test cases ! But I'm afraid it still somewhat lacks novelty!

    • Also you can reduce the random tests to 100

    • Use description-formatting for example tests and remove the function block (as well as parameter names) !