Ad
Code
Diff
  • #Onelined again...
    def above_two(arg): return arg>2
    • #Onelined again...
    • def above_two(arg): return True
    • def above_two(arg): return arg>2
Fundamentals
Code
Diff
  • import random
    
    def dice():
        return random.choice(["⚀", "⚁", "⚂", "⚃", "⚄", "⚅"])
            
            
        
    • import random
    • def dice():
    • dice_faces = ["⚀", "⚁", "⚂", "⚃", "⚄", "⚅"]
    • return random.choice(dice_faces)
    • return random.choice(["⚀", "⚁", "⚂", "⚃", "⚄", "⚅"])
Code
Diff
  • def multiply_and_add_one(a, b):
        return a * b + 1
    
    • def multiply_and_add_one(a, b):
    • r = a * b
    • return r + 1
    • return a * b + 1