• 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
JSONMartin Avatar
Name:Jason Martin
Clan:Unknown
Member Since:Mar 2016
Last Seen:Dec 2021
Profiles:
Following:0
Followers:1
Allies:0
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (9)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • guna_1199
    • commented on "Delete occurrences of an element if it occurs more than n times" python solution
    • 5 years ago

    can you explain this code to me ? thanks

  • Custom User Avatar
    • DJTB
    • commented on "Return 17" javascript solution
    • 8 years ago

    haha, well played.

  • Custom User Avatar
    • JSONMartin
    • commented on "Integers: Recreation One" python solution
    • 8 years ago

    hahaha. just wow.

  • Custom User Avatar
    • JSONMartin
    • commented on "Numbers with this digit inside" javascript solution
    • 8 years ago

    Yes =)

    Can also can calculate the sum and product in the for loop as well, improving the runtime by from 3 linear passes over the array down to just one.

  • Custom User Avatar
    • eightyeighteyes
    • commented on "Binary Addition" python solution
    • 9 years ago

    Sure, I see that. My intent in commenting was merely to point out to others that are learning the craft/language that lambdas generally shouldn't be assigned to names.

    EDIT: Poking around the site, I see that there are a lot of code golf type answers around. I guess it's probably not worth being so pedantic around here.

  • Custom User Avatar
    • lechevalier
    • commented on "Binary Addition" python solution
    • 9 years ago

    As I should normally agree with you, you seem to forget that main purpose of PEP 8 is to provide some guidance to write cleaner code, not to be an absolute reference when coming to code conventions.

    PEP8 introduction states itself that

    Many projects have their own coding style guidelines. In the event of any conflicts, such project-specific guides take precedence for that project.

    The only moment when you have to follow PEP8 strictly and blindly is when writing an official builtin module for Python distribution itself. Even third party packages listed on PyPi are not confined to PEP8 recommendations.

    So please keep in mind that this solution main purpose is code golf - a type of recreational computer programming game where an answer is favoured for its shortness rather than its clearness and designed to be entertaining.
    That is also the reason why CodeWars provides two distinct categories to classify solutions:

    • Best practices where solutions tend to enforce readibility and performance.
    • Clever where solutions are twisted and definitely not designed for production but providing an original approach to resolve a problem.
  • Custom User Avatar
    • eightyeighteyes
    • commented on "Binary Addition" python solution
    • 9 years ago

    Assigning a lambda expression to a name is a PEP8 violation, though:

    https://www.python.org/dev/peps/pep-0008/#programming-recommendations

  • Custom User Avatar
    • JSONMartin
    • commented on "Grasshopper - Grade book" javascript solution
    • 9 years ago

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

  • Custom User Avatar
    • JSONMartin
    • commented on "suic's fork of JSONMartin's Python solution for "Sort by Example"" kumite
    • 9 years ago

    Cool, thanks for the feedback!

    Still fairly new to Python as I'm coming from a Javascript background, so learning all the Python specific sugar such as Counter. I'll make sure to keep this one in mind!

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

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...