cats = 4 print "cats are cozy" print "6" print 2*3 Cat = "Cozy Cat" print len(Cat) Cat = "Cozy Cat" print Cat.lower() cat = "cozy cat" print cat.upper() def greater_less_equal_5(answer): if answer > 5: return 1 elif answer < 5: return -1 else: return 0 print greater_less_equal_5(4) print greater_less_equal_5(5) print greater_less_equal_5(6) True and True is True bool_one = False and False def cat(): """print "CATS!" to the console""" print 'CATS!' names = ["Steph", "Peanut", "Stepheroni", "Goober"] for item in names: print item
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