list1 = ["cat","dog","horse"] print list1 list1.append("starfish") print list1 list1.append("starfish") print list1 animals = set(list1) print animals print animals while len(list1)<30: n = "go" list1.append(n) print list1 flag1 = [] if len(list1)>29: flag1.append("go") if len(flag1)>0: while len(list1)>5: list1.remove("go") print list1 a = raw_input(">>> ") if a == "q": print "q" else: print "~q" a = raw_input(">>> ")
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