Ad
  • Custom User Avatar

    What does your function return for negative numbers like -3? Read the description again. Also, printing the input would help you debug your code.

  • Custom User Avatar

    First of all, your code is almost unreadable because it's all on one line. Format it properly as shown here https://docs.codewars.com/references/markdown/#code-block

    Secondly, from description:

    a prime number is a natural number greater than 1

    Why are you bothering with negative numbers then?

    It also looks like you got some flawed logic in your else statement, but it's just a guess because, again, your code is unreadable right now.