#variables print "This program is a demo of variables" v = 1 print "The value of v is now", v print v v = v + 1 print "v now equals itself plus one, making it worth", v v = v * 2 print "v now equals itself times two, making it worth", v v = 51 print "v can store any numberical value, to be used elsewhere" print "for example, in a sentence. v is now worth", v print "v times 5 equals", v*5 print "v times 10 equals", v*10 print "v plus 10 equals", v+10
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