#just a comment myInteger = 5 yourInteger = myInteger myBool1 = True myBool0 = False if myInteger == 2: print "hello" elif myInteger == 4 or myInteger == 5: print "blub" else: print "hi" myObject = None #myObject = "hello" if myObject is not None: print "tis etwadde" else: print "tis niet" myIntList = [1, 3, 7] for anInt in myIntList: print anInt myOtherList = [1, "hello", 7.2] for anInt in myOtherList: print anInt myDict = {"h1":"piep", "h2":"poep"} for anEntry in myDict.keys(): print anEntry for aKey, aValue in myDict.iteritems(): print aKey,aValue if "piep" in myDict.values(): print "piep in there"
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