#List shopping_list=['veggies','egg','cheese'] print shopping_list #single thing on list count=len(shopping_list) for item in range(0,count): print shopping_list [item] #better way of previous solution for item in shopping_list: print item #A type is a classifacation of an object #a=5 #5+2 #Type conversion is when you change an integer into a string #5+'x' #If in use have "print str(5)+'x'" other wise it won't work #print str(5)+'x' #'5'+'x' #'5x' #1-10 loop for var in range(0,11): print var #Separate from previous thing str='abcde' print (str[0]=='a')
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