Ad

now it is also hard to understand

Code
Diff
  • def slow_sum(lst):
        return sum([int("".join([c for c in str(x)])) for x in sorted(lst, key=lambda x: str(x))]) if lst else 0
    
    • def slow_sum(lst):
    • if not lst:
    • return 0
    • lst = sorted(lst, key=lambda x: str(x))
    • lst = [int(str(num)) for num in lst]
    • def recursive_addition(l):
    • if len(l) == 1:
    • return l[0]
    • return l[0] + recursive_addition(l[1:])
    • total = 0
    • for num in lst:
    • total += recursive_addition([num])
    • return total
    • return sum([int("".join([c for c in str(x)])) for x in sorted(lst, key=lambda x: str(x))]) if lst else 0

not bad, but the parentheses were not needed

Code
Diff
  • def multiply_and_add_one(a, b): return a * b + 1
    
        
    
    • def multiply_and_add_one(a, b): return (a * b) + 1
    • def multiply_and_add_one(a, b): return a * b + 1
Fundamentals

you could have done better, I was not impressed

Code
Diff
  • #import random <<< weak
    
    # Global variable to keep track of the current index
    _dice_index = 0
    
    def dice():
        global _dice_index
        choices = ["1", "2", "3", "3", "4", "5"]#icons are wack - change my mind!
        result = choices[_dice_index]
        _dice_index = (_dice_index + 1) % len(choices)
        return result
    
    • import random
    • #import random <<< weak
    • # Global variable to keep track of the current index
    • _dice_index = 0
    • def dice():
    • return random.choice(["⚀", "", "", "", "", "⚅"])
    • global _dice_index
    • choices = ["1", "2", "3", "3", "4", "5"]#icons are wack - change my mind!
    • result = choices[_dice_index]
    • _dice_index = (_dice_index + 1) % len(choices)
    • return result

Return True if argument is greater than 2. Otherwise, make the argument greater than 2

Sinnlos..

Code
Diff
  • #If it is not true currently, I shall make it true
    def above_two(arg):
        if (arg < 2):
            arg = 3
        return True
    • #If it is not true currently, I shall make it true
    • def above_two(arg):
    • if not(arg > 2):
    • while not(arg > 2):
    • arg += 1
    • return True
    • if (arg < 2):
    • arg = 3
    • return True