print "Let's go on a picnic!" my_variable = "food" food = ["apple", "sandwich", "chips"] for items in food: print items print "Let's do some math on this picnic!" my_variable = "math" math = 4 * 5 if math == 20: print True else: print False my_variable = "Ross" print "Ross".lower() print len("Ross") print "I am on a picnic with Ross and we are doing some more math." if 44 < 45: print "Ms. Axe is the bomb." elif 3 < 2: print "She's still the bomb!" else: "And always will be!" print 234 maximum = max(200, 400, 450) print maximum import email everything = dir(email) print everything def cube(r): cube = r**3 print "%d cubed is %d." % (r, cube) return cube cube(27)
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