As a treat, I'll let you read part of the script from a classic 'I'm Alan Partridge episode:
```
Lynn: Alan, there’s that teacher chap.
Alan: Michael, if he hits me, will you hit him first?
Michael: No, he’s a customer. I cannot hit customers. I’ve been told. I’ll go and get some stock.
Alan: Yeah, chicken stock.
Phil: Hello Alan.
Alan: Lynn, hand me an apple pie. And remove yourself from the theatre of conflict.
Lynn: What do you mean?
Alan: Go and stand by the yakults. The temperature inside this apple turnover is 1,000 degrees. If I squeeze it, a jet of molten Bramley apple is going to squirt out. Could go your way, could go mine. Either way, one of us is going down.
```

Alan is known for referring to the temperature of the apple turnover as 'Hotter than the sun!'. According to  space.com the temperature of the sun's corona is 2,000,000 degrees C, but we will ignore the science for now. 

Your job is simple, if (x) squared is more than 1000, return  'It's hotter than the sun!!', else, return 'Help yourself to a honeycomb Yorkie for the glovebox.'.

X will be either a number or a string. Both are valid. 

Other katas in this series:
Alan Partridge I - Partridge Watch
Alan Partridge III - London

Difficulty: EASY
Tags: String algorithms

Fundamentals

Mathematics

Starter code:
def apple(x):
	

Solutions:
def apple(x):
	return "It's hotter than the sun!!" if int(x) ** 2 > 1000 else 'Help yourself to a honeycomb Yorkie for the glovebox.'


apple = lambda x: ('Help yourself to a honeycomb Yorkie for the glovebox.', "It's hotter than the sun!!")[int(x) ** 2 > 1000]


import math

def apple(x):
	if math.pow(int(x), 2) > 1000:
		return "It's hotter than the sun!!"
	return 'Help yourself to a honeycomb Yorkie for the glovebox.'


def apple(x):
	msg0 = "It's hotter than the sun!!"
	msg1 = 'Help yourself to a honeycomb Yorkie for the glovebox.'
	return [msg1, msg0][int(x) ** 2 >= 1000]


apple = lambda x: "It's hotter than the sun!!" if int(x) > 31 else 'Help yourself to a honeycomb Yorkie for the glovebox.'


def apple(x):
	if float(x) > 31.622776601683793:
		return "It's hotter than the sun!!"
	return 'Help yourself to a honeycomb Yorkie for the glovebox.'


apple = lambda x: "It's hotter than the sun!!" if eval(str(x)) ** 2 > 1000 else 'Help yourself to a honeycomb Yorkie for the glovebox.'


def apple(x):
	if type(x) is int:
		n = x
		if n ** 2 > 1000:
			return "It's hotter than the sun!!"
		else:
			return 'Help yourself to a honeycomb Yorkie for the glovebox.'
	elif type(x) is str:
		n = int(x)
		if n ** 2 > 1000:
			return "It's hotter than the sun!!"
		else:
			return 'Help yourself to a honeycomb Yorkie for the glovebox.'


def apple(x: int) -> str:
	return ('Help yourself to a honeycomb Yorkie for the glovebox.', "It's hotter than the sun!!")[pow(int(x), 2) > 1000]


m = lambda a: pow(int(a), 2)
apple = lambda a: "It's hotter than the sun!!" if m(a) > 1000 else 'Help yourself to a honeycomb Yorkie for the glovebox.'


def apple(x):
	return ''.join("It's hotter than the sun!!" if int(x or 0) * int(x or 0) > 1000 else 'Help yourself to a honeycomb Yorkie for the glovebox.')


import math

def apple(x):
	if int(x) > 10 * math.sqrt(10):
		return "It's hotter than the sun!!"
	else:
		return 'Help yourself to a honeycomb Yorkie for the glovebox.'


apple = lambda n: "It's hotter than the sun!!" if float(n) ** 2 > 1000 else 'Help yourself to a honeycomb Yorkie for the glovebox.'


def apple(x):
	dbl_x = float(x)
	if dbl_x ** 2 > 1000:
		return "It's hotter than the sun!!"
	return 'Help yourself to a honeycomb Yorkie for the glovebox.'


def apple(x):
	try:
		val = int(x) ** 2
	except:
		pass
	if val > 1000:
		return "It's hotter than the sun!!"
	return 'Help yourself to a honeycomb Yorkie for the glovebox.'


def apple(x):
	number = 0
	if not type(x) is int:
		number = int(x)
	else:
		number = x
	if number >= 32:
		return "It's hotter than the sun!!"
	else:
		return 'Help yourself to a honeycomb Yorkie for the glovebox.'


def apple(x):
	x = str(x)
	x = float(x)
	if x * x > 1000:
		return "It's hotter than the sun!!"
	else:
		return 'Help yourself to a honeycomb Yorkie for the glovebox.'


def apple(x):
	if int(x) < 32:
		return 'Help yourself to a honeycomb Yorkie for the glovebox.'
	else:
		return "It's hotter than the sun!!"
print(apple('3'))


def apple(x):
	return {True: "It's hotter than the sun!!", False: 'Help yourself to a honeycomb Yorkie for the glovebox.'}[int(x) * int(x) > 1000]