Ad
  • Custom User Avatar

    Alr, could've probably guessed that but being more sure is always nice. Thx :D

  • Custom User Avatar

    One-time math calculations are normally O(1), although it depends on how they are implemented.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    alright thx, btw my original plan was to just make a simple function where you'd have to see how many times num2 fits in num1, is that a good kata instead of my thing or is it also a bit meh

    would go a little like this

    def modulo(num1,num2):
        if num1 > num2 and num2 > 0:
           return (num1 - num1 % num2) / num2
        else:
           return 0
    

    With this code you could see how many times num2 fits in num1, though it's pretty basic, it's still something new ppl could use to learn about modulus right?

  • Custom User Avatar

    I have seen multiple kata's where you should return a list in this kind of kata,

    There are a lot of low quality katas from ancient times

    No clue how to do those,

    https://docs.codewars.com/authoring/guidelines/submission-tests

    Yea I had no clue with that myself, when I typed in 4.5 it rounded to 4, ...

    There should be full specifications (e.g. round up/down/...), not "with this input I got this output".
    In this case the best option is: avoid floats and pass only integers.

  • Custom User Avatar

    Should I remove this kata then to prevent confusion for others or can I just leave it up.
    Nvm it's retired

  • Custom User Avatar

    Choose a task (more complex than a builtin function call) and pass valid args of the right type.

  • Custom User Avatar

    You should read kata authoring guidelines next time before creating a kata

  • Custom User Avatar
    • Alr I'll leave it one type next time, though it isn't a big problem right?
    • I have seen multiple kata's where you should return a list in this kind of kata, but I'll keep that in mind
    • No clue how to do those, probably should have looked into em. Maybe I'll add em later
    • Yea I had no clue with that myself, when I typed in 4.5 it rounded to 4, which had me confused and thinking it's something standard, meanwhile 4.55 does return 5
  • Custom User Avatar
    • returning different types (int/list) is bad practice
    • the right way of returning two values in python is using a tuple, not a list
    • no random tests
    • "for some reason 4.5 = 4" -> no, description should say how numbers shopuld be rounded; P.S. and 5.5?
  • Custom User Avatar

    What could I change then? It's my first kata so I'm just trying stuff