• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
k.dmitriy.a@gmail.com Avatar
Name:Dmitriy
Clan:Ukraine
Member Since:May 2022
Last Seen:Jan 2024
Profiles:
Following:158
Followers:153
Allies:153
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (7)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • k.dmitriy.a@gmail.com
    • commented on "Check Even Number" kumite
    • 2 years ago

    You used my previous solution ;)

  • Custom User Avatar
    • Mustafa89
    • commented on "This number is even or odd?" kumite
    • 2 years ago

    Yes, the function even_or_odd returns the string "Even" if the input n is even and "Odd" if the input n is odd

  • Custom User Avatar
    • SaraLightBourne
    • commented on "This number is even or odd?" kumite
    • 2 years ago

    alright i'm sorry

  • Custom User Avatar
    • PaoloCarlevero
    • commented on "This number is even or odd?" kumite
    • 2 years ago

    Hi Sara,

    I would suggest you to try to run the code. The module operator (%) return the reminder in the division between the first and the second number. 6 divided by 2 is 3 with 0 as remainder, so in this code would be select the first item in the tuple, "Even", that is correct. Your version is easier to understand and more suitable for python, but the code written by graf_da still works.

  • Custom User Avatar
    • SaraLightBourne
    • commented on "This number is even or odd?" kumite
    • 2 years ago

    if i enter "6", your code will throw KeyError because 6 % 2 == 2. so i'd rather do

    def even_or_odd(n: int) -> str:
      return 'Even' if n % 2 == 0 else 'Odd
    
  • Custom User Avatar
    • k.dmitriy.a@gmail.com
    • commented on "double value: binary except I have trouble with using 2's complement " kumite
    • 2 years ago

    We have a fun time ¯\(ツ)/¯

  • Custom User Avatar
    • juridetochkin
    • commented on "double value: binary except I have trouble with using 2's complement " kumite
    • 2 years ago

    what are you guys doin here?
    :)

  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...