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 xnonlocal outputif nice:output = "You've been nice!" + '🎁' * xreturn outputdef heat_coal():nonlocal xnonlocal outputoutput = "You've been naughty!" + '🔥' * xif naughty:return outputdef santa():nonlocal xnonlocal 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