for looper in [1, 2, 3, 4, 5]: print "hello" for looper in [1, 2, 3, 4, 5]: print looper for looper in [1, 2, 3, 4, 5]: print looper, "times 8 =", looper*8 for looper in range (1, 9): print looper, "times 8 =", looper*8 print " " for looper in range (11): print looper, "times 8 =", looper*8 print " " for letter in "Hi there": print letter print " " for i in range (1, 10, 2): print i print " " for i in range (5, 26, 5): print i for i in range (10, 0, -1): print i print " " print " " print " " print "Type 3 to continue, anything else to quit." someInput = raw_input() while someInput == '3' : print "Thank you for the 3. Very kind of you." print "Type 3 to continue, anything else to quit." someInput = raw_input() print "That's not 3, so I'm quitting now!" print " " print " " print " " for i in range(1, 6): print print "i =", i, print "Hello, how", if i == 3: break print "are you today?"
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