Start a new Kumite
AllAgda (Beta)BF (Beta)CCFML (Beta)ClojureCOBOL (Beta)CoffeeScriptCommonLisp (Beta)CoqC++CrystalC#D (Beta)DartElixirElm (Beta)Erlang (Beta)Factor (Beta)Forth (Beta)Fortran (Beta)F#GoGroovyHaskellHaxe (Beta)Idris (Beta)JavaJavaScriptJulia (Beta)Kotlinλ Calculus (Beta)LeanLuaNASMNim (Beta)Objective-C (Beta)OCaml (Beta)Pascal (Beta)Perl (Beta)PHPPowerShell (Beta)Prolog (Beta)PureScript (Beta)PythonR (Beta)RacketRaku (Beta)Reason (Beta)RISC-V (Beta)RubyRustScalaShellSolidity (Beta)SQLSwiftTypeScriptVB (Beta)
Show only mine

Kumite (ko͞omiˌtā) is the practice of taking techniques learned from Kata and applying them through the act of freestyle sparring.

You can create a new kumite by providing some initial code and optionally some test cases. From there other warriors can spar with you, by enhancing, refactoring and translating your code. There is no limit to how many warriors you can spar with.

A great use for kumite is to begin an idea for a kata as one. You can collaborate with other code warriors until you have it right, then you can convert it to a kata.

Ad
Ad

Alternative solution.

Code
Diff
  • def solution(param: list) -> bool:
        return list(map(lambda e: e is True, param)).count(True) >= 2
    • def solution(param: list) -> bool:
    • """Returns True if atleast 2 out of 3 booleans are True."""
    • return sum(map(lambda e: e is True, param)) > 1
    • return list(map(lambda e: e is True, param)).count(True) >= 2

If you're going to do it this way, at least do it right. Don't branch to boolean, and remove repeated parts!

Code
Diff
  • is_palindrome = lambda s: s in ["Taco Cat", "Are we not pure? No, sir! Panama's moody Noriega brags. It is garbage! Irony dooms a man - a prisoner up to new era.", "A man, a plan, a canal - Panama.", "Are we not drawn onward to new era?"] # This won't work if you add in random test cases lol
    • is_palindrome=lambda a:True if a=="Taco Cat" or a=="Are we not pure? No, sir! Panama's moody Noriega brags. It is garbage! Irony dooms a man - a prisoner up to new era." or a=="A man, a plan, a canal - Panama." or a=="Are we not drawn onward to new era?" else False#this wont work if you add in random test cases lol
    • is_palindrome = lambda s: s in ["Taco Cat", "Are we not pure? No, sir! Panama's moody Noriega brags. It is garbage! Irony dooms a man - a prisoner up to new era.", "A man, a plan, a canal - Panama.", "Are we not drawn onward to new era?"] # This won't work if you add in random test cases lol

a very simple calculator

Code
Diff
  • calc = lambda eq: eval(eq)
    
    
    • calc = lambda func, n1, n2: eval(f'{n1}{func}{n2}') if func in ['+', '-', '*', '/'] else None
    • calc = lambda eq: eval(eq)
Code
Diff
  • x = "Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those!"
    y = [21,1,8,27,88,9,478,97,18,34,129]
    print("".join(x[z] for z in y))
    • import codecs
    • exec(codecs.encode('cevag(pbqrpf.rapbqr("".wbva([v sbe v va pbqrpf.rapbqr("uryyb jbeyq",rapbqvat="ebg13",reebef="vtaber")]),rapbqvat="ebg13",reebef="vtaber"))',encoding="rot13",errors="ignore"))
    • x = "Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those!"
    • y = [21,1,8,27,88,9,478,97,18,34,129]
    • print("".join(x[z] for z in y))