Ad
Code
Diff
  • return_10 = lambda: ord("d") - ord("Z")    
    • import math
    • def return_10():
    • a = int((ord("}")*ord(""))**(ord("o")/ord("ō")))+1
    • b = ((1+1)-(math.cos(69)**2 + math.sin(69)**2))-1
    • c = ((2-1)-(math.cos(69)**2 + math.sin(69)**2))+1
    • d = (1-27)*(4+27)+27*(4-1+27)-1
    • return int(a - round(b - c, 0)) + int(math.sqrt(d)) - 2
    • print(return_10())
    • return_10 = lambda: ord("d") - ord("Z")
Code
Diff
  • def addition(a, b):
        num_of_ones = []
        
        for n in range(a):
            num_of_ones.append(1)
        
        for n in range(b):
            num_of_ones.append(1)
        
        return len(num_of_ones)
    • def c(a,b):
    • d=lambda a,b: int(bin(a),2)+int(bin(b),2)
    • def f():
    • nonlocal a
    • nonlocal b
    • return d(a,b)
    • return f()
    • addition = c
    • def addition(a, b):
    • num_of_ones = []
    • for n in range(a):
    • num_of_ones.append(1)
    • for n in range(b):
    • num_of_ones.append(1)
    • return len(num_of_ones)
Strings
Code
Diff
  • baked = lambda raw_cake: raw_cake.title()
    ingredients = {"c": 1,
                   "a": 1,
                   "k": 1,
                   "e": 1}
    
    def cake_maker(word: str) -> str:
        raw_cake = "".join(ing for ing in ingredients.keys())
        found_ingredients = "".join(i for i in 'cake' if i in word.lower())
        return baked("cake") if raw_cake == found_ingredients else "Not enough to make the cake!"
    • baked = lambda raw_cake: raw_cake.title()
    • ingredients = {"c": 1,
    • "a": 1,
    • "k": 1,
    • "e": 1}
    • def cake_maker(word: str) -> str:
    • ingredients = 'cake'
    • cake_mix = set()
    • idx = 0
    • while idx != len(word):
    • if word[idx].lower() in ingredients:
    • cake_mix.add(word[idx].lower())
    • idx += 1
    • if len(cake_mix) == len(ingredients):
    • return 'Cake'
    • return 'Not enough to make the cake!'
    • raw_cake = "".join(ing for ing in ingredients.keys())
    • found_ingredients = "".join(i for i in 'cake' if i in word.lower())
    • return baked("cake") if raw_cake == found_ingredients else "Not enough to make the cake!"
Strings

Description:

As input you recieve a random word.
Your job is to find out can you make a Cake from it.

That is done by finding all the letters that make the word "cake" in the given word.
If all of them are present, make the Cake and return it.
If not, say "Not enough to make the cake!".

Example:

Input: "Cupcake"
-->
Output: "Cake"

Input: "Coffee"
-->
Output: "Not enough to make the cake!"


Notes:

  • It's not case sensitive, meaning that "Cupcake" and "CupCake" will both suffice to return the "Cake".
def cake_maker(word: str) -> str:
    for let in "cake":
        if let in word.lower():
            continue
        else: return "Not enough to make the cake!"
    return "Cake"