def square(x): return int(x) * int(x) def yolo(number): return sum(map(square, list(str(number)))) def liststuff(number): seen_numbers = set() while number > 1 and (number not in seen_numbers): seen_numbers.add(number) number = yolo(number) return number == 1 def check(number): if number == 1: return True elif number == 4: return False else: return liststuff(yolo(number)) in1 = raw_input("Please enter a number to see if Mr lemont likes it!") if in1 > 0: if thisthing(int(in1)): print("Mr. Lemont likes theat number!") else: print("Mr. Lemont does not like that number!") else: print("Mr. Lemont does not like that number!")
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question