print "I will now count my chickens:" print "Hens", 25 + 30 / 6.0 print "Roosters", 100.0 - 25.0 * 3.0 % 4.0 print "Now I will count the eggs:" print 3 + 2 + 1 - 5 + 4 % 2 - 1.0 / 4 + 6 # need to use floats specifically for the numbers (at least one per operation) # that you don't want rounded (other numbers can be integers) print "Is it true that 3 + 2 < 5 - 7?" print 3.0 + 2.0 < 5.0 - 7.0 # floats just because; doesn't make a difference here print "What is 3 + 2?", 3.0 + 2.0 print "What is 5 - 7?", 5.0 - 7.0 print "Oh, that's why it's False." print "Is it greater?", 5.0 > -2.0 print "Is it greater or equal?", 5.0 >= -2.0 print "Is it less or equal?", 5.0 <= -2.0
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