def puns(a,b,c): if a==b or b<c: return "Did you hear about the guy whose whole left side was cut off? He's all right now." elif a==b and a==c: return "I'm reading a book about anti-gravity. It's impossible to put down." elif not b!=c: return "Yesterday I accidentally swallowed some food coloring. The doctor says I'm OK, but I feel like I've dyed a little inside." else: return "The roundest knight at king Arthur's round table was Sir Cumference." print puns(1,2,3) print puns(1,2,2) print puns(1,1,1) print puns(1,4,2)
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