Ad
Code
Diff
  • import random
    
    def elf_hub(nauthy, nice):
        x = random.randint(1, 3)
        
        if nice and not nauthy:
            return "You've been nice!" + '🎁' * x
        elif not nice and nauthy:
            return "You've been naughty!" + '🔥' * x
        elif nauthy and nice:
            return "Youve been naughty and nice" + '🎅' + x * 'Ho'
        
        return None
    
    • import random
    • def elf_hub(naughty, nice):
    • output = ''
    • def elf_hub(nauthy, nice):
    • x = random.randint(1, 3)
    • def giftwrap():
    • nonlocal x
    • nonlocal output
    • if nice:
    • output = "You've been nice!" + '🎁' * x
    • return output
    • def heat_coal():
    • nonlocal x
    • nonlocal output
    • output = "You've been naughty!" + '🔥' * x
    • if naughty:
    • return output
    • def santa():
    • nonlocal x
    • nonlocal output
    • if nice and not nauthy:
    • return "You've been nice!" + '🎁' * x
    • elif not nice and nauthy:
    • return "You've been naughty!" + '🔥' * x
    • elif nauthy and nice:
    • return "Youve been naughty and nice" + '🎅' + x * 'Ho'
    • if nice and not naughty:
    • return giftwrap()
    • elif not nice and naughty:
    • return heat_coal()
    • elif naughty and nice:
    • return santa()
    • else:
    • return None
    • return None