# Place your data set after 'str' and between the 2 quotation marks. # Your data should be red after you do this. If it's not then make # sure your data is surrounded with 2 quotation marks. # You can also use 3 quotation marks if you can't fit all the data into one line. # See module 1's example down below. str = "57 61 57 57 58 57 61 54 68 51 49 64 50 48 65 52 56 46 54 49 51 47 55 55 54 42 51 56 55 51 54 51 60 62 43 55 56 61 52 69 64 47 54 48" print "Parsing string: %s" % str str = str.split() print "Length of list: %d" % len(str) for num in str: print num print "------------------------------------" ## Example: ## New Car Model Data for Module 1's sample test: str = """9333 11392 12358 13895 14076 14540 16769 19447 19522 19768 21374 21880 22457 23313 23916 24810 25378 25850 27412 28163 29172 29381 30128 31193 31642 31702 35690 36550 37576 41319 """ print "Parsing string: %s" % str str = str.split() print "Length of list: %d" % len(str) for num in str: print num
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