Ad
Strings
Code
Diff
  • roll_dice=lambda d:[__import__("random").randint(1,int(d.split("d")[1]))for _ in range(int(d.split("d")[0]))]
    • import random
    • def roll_dice(dice):
    • r,s=map(int,dice.split('d'))
    • return[random.randint(1,s)for _ in range(r)]
    • roll_dice=lambda d:[__import__("random").randint(1,int(d.split("d")[1]))for _ in range(int(d.split("d")[0]))]
Code
Diff
  • Greeting=lambda name,rank=None,formal=False: lambda:f'He{["y","llo"][formal]}, {[str(rank)+" ",""][not rank or not formal]}{name}{chr(33+formal*13)}'
    • Greeting=lambda name,rank=None,formal=False: lambda:f'He{["y","llo"][formal]}, {[str(rank)+" ",""][rank is None or not formal]}{name}{chr(33+formal*13)}'
    • Greeting=lambda name,rank=None,formal=False: lambda:f'He{["y","llo"][formal]}, {[str(rank)+" ",""][not rank or not formal]}{name}{chr(33+formal*13)}'