## This is a test program written by Appa ## If you want to write a comment, like I am doing here ## you need to start it with a # ## On this page, everything needs to be written in Python, a pretty ## powerful language that is also relatively easy to read ## 1) Using Loops ## the function "range" creates a list starting from 0 and increasing by 1 ## that is as long as the number given. E.g., range(10) gives the numbers ## 0 - 9 (since that is 10 numbers, total). for my_iter in range(100): ## things that are indented are part of the "for" loop!! print(str(my_iter) + " + " + str(my_iter) + " = " + str(2 * my_iter) ) print("Not bad, huh?")
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