print "1 Duck's Journey: A Simple Duck" #variable print len("A_duck_is_a_majestic_creature") #length print 1 #print number print "ducks like grapes" # print string print 1 == 1 # arithmetic print "DUCK".lower() #lower / upper print 1 #print number booltwo = (2 >= 2) and (3 == 3) print booltwo #boolean def duck(): print """I love ducks""" #function Ducks = ["Adam","Alex","Mariah","Martine","Columbus"] print Ducks #list for each in Ducks: + 1 #for loop
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