name = 'Ryan J. Westcott' age = 30 #not a lie height = 77.375 #inches weight = 230 #pounds if weight > 200: judgement = 'overweight' elif weight < 160: judgement = 'underweight' else: judgement = 'a healthy weight' eyes = 'brown' hair = 'brown' teeth = 'crooked' pounds_to_newtons = 4.5454 newtons_to_kg = 1/9.8 print "Let's talk about %s." % name print "He is %d years old." % age print "He is %d feet, %.3f inches tall" % (int(height/12), height - int(height/12)*12), print "(about %d'%d\")" % (int(height/12), height - int(height/12)*12) print "He weighs %d pounds -" % weight, print "that's %s." % judgement print "He's got %s eyes and %s hair" % (eyes, hair) print "His teeth are perpetually %s" % teeth print "For Canadians: His height is %d cm and his weight is %d N, meaning that his mass is %d kg" % (my_height * 2.54, my_weight*pounds_to_newtons, my_weight*pounds_to_newtons*newtons_to_kg)
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