Open main menu

CDOT Wiki β

Changes

OPS435 Python Exercise 1

5 bytes removed, 22:06, 21 June 2018
Created page with "= Objectives = * read a single line from a text file * split a single line into words and store all the words in a list * combine selected items from a list to make useful dat..."
= Split a single line into words and store all the words in a list =
Python code to split the line "line_in" into words:
<pre>
word_list = line_in.split() # <-- split the line into words using space
# store all the words as a list to word_list
1,760
edits