Ad
Code
Diff
  • binary=lambda n:bin(n)[2:]
    • binary=lambda n: bin(n).replace("0b", "")
    • binary=lambda n:bin(n)[2:]
Code
Diff
  • binary = lambda n: bin(n).replace('0b','')
    • def binary(n):
    • output = ''
    • while n:
    • if n%2:
    • output += '1'
    • else:
    • output += '0'
    • n=n//2
    • return output[::-1]
    • binary = lambda n: bin(n).replace('0b','')
Code
Diff
  • where = lambda thing="codewar",home="home",food="dorito",phone="phone" : f"where were u wen {thing} die?\ni was at {home} eatin {food} wen {phone} ring\n\"{thing} is kil\"\n\"no\""
    • def where(thing="codewar", home="home", food="doorito", phone="phone"):
    • return "\n".join(
    • ["where were u wen {} die?", "i was at {} eatin {} wen {} ring", "\"{} is kil\"", "\"no\""]).format(
    • thing, home, food, phone, thing)
    • where = lambda thing="codewar",home="home",food="dorito",phone="phone" : f"where were u wen {thing} die?\ni was at {home} eatin {food} wen {phone} ring\n\"{thing} is kil\"\n\"no\""
Code
Diff
  • binary_to_integer = lambda n: int(n, 2)
    • def binary_to_integer(b):
    • return sum([x[0] for x in list(zip([pow(2,i) for i in range(len(b))], reversed(b))) if x[1] == '1'])
    • binary_to_integer = lambda n: int(n, 2)

Return all possible permutations of the array.

Code
Diff
  • from itertools import permutations
    
    all_permutations = lambda lst: list(permutations(lst))
    • import itertools
    • from itertools import permutations
    • def all_permutations(lst):
    • return list(itertools.permutations(lst))
    • all_permutations = lambda lst: list(permutations(lst))

Return all possible permutations of the given array.

import itertools

def all_permutations(lst):
    
    return list(itertools.permutations(lst))
Code
Diff
  • your_name = lambda n = 'Taki': f"Hello {n}, you are very kool!"
    • def your_name(n=None):
    • return f"Hello {n if n is not None else 'Taki'}, you are very kool!"
    • your_name = lambda n = 'Taki': f"Hello {n}, you are very kool!"
Code
Diff
  • "what's the purpose of this kumite???"
    • ""
    • "what's the purpose of this kumite???"
Code
Diff
  • lenght_line =  lambda: 'ksnfgjji233jc,'
    • def lenght_line(line='marry, ksnfgjji233jc, harry!@#'):
    • return 'ksnfgjji233jc,'
    • lenght_line = lambda: 'ksnfgjji233jc,'
Code
Diff
  • should_return_1 = lambda: 1
    • def should_return_1():
    • return 1
    • should_return_1 = lambda: 1
Code
Diff
  • why = lambda: 'w - h - y'
    • def why():return f"w - h - y"
    • #3333333333333333
    • why = lambda: 'w - h - y'
Code
Diff
  • remainder = lambda x,y: x % y if x and y else -1
    • def remainder(x, y):
    • if x == 0 or y == 0:
    • return -1
    • rem = x % y
    • return rem
    • remainder = lambda x,y: x % y if x and y else -1
Code
Diff
  • exp = lambda: None
    • def exp():
    • for i in range(3):
    • print('\a')
    • for i in range(10000, 10006):
    • print(chr(i))
    • exp = lambda: None
Code
Diff
  • lol = lambda:'lol'.count('l')
    • def lol():return 2
    • lol = lambda:'lol'.count('l')
Code
Diff
  • magick_message = lambda i: 'abracadabra!' if i else 'codewarz'
    • import random
    • def magick_message(kumite):
    • idx = ((3, 9), (7, 6))[kumite]
    • return '-#Vcul$a*%D&ob#8Vx!r0d~Pla,y^0ec54Px#a0w7-9d*@^%aa=+xZ0b`r3/1r-nr0za^%$g6!0'[idx[0]::idx[-1]]
    • magick_message = lambda i: 'abracadabra!' if i else 'codewarz'
Loading more items...