print 4 type('Hello, World?') type(17) type(3.2) type('17') type('3.2') print 1,000,000 message = "What's up, Doc?" n = 17 pi = 3.14159 print message print n print pi type(message) type(n) type(pi) #76trombones = 'big parade' #more$ = 1000000 #class = 'Computer Science 101' print 1 x = 2 print x 1 + 1 17 x message = 'Hello, World!' message print message print 17 print 3.2 print 'Hello, World!' print 1 + 1 hour = 60 minute = 60 20 + 32 hour - 1 hour * 60 + minute minute / 60 5 ** 2 (5 + 9) * (15 - 7) minute = 59 minute / 60 minute * 100 / 60 #message - 1 #'Hello' / 123 #message * 'Hello' #'15' + 2 fruit = 'banana' bakedGood = ' nut bread' print fruit + bakedGood print 17 + 3 print 'Number of minutes since midnight:', hour * 60 + minute #compute the percentage of the hour that has passed percentage = (minute * 100) / 60 #caution: integer division percentage = (minute * 100) // 60
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