title: Organizing and printing certain words from a text file in Python
body: <p>I'm a bit new to Python and I had a bit of question regarding how you would get it to extract and organize certain words from a text file. So for example, I made a text file to illustrate:</p>
  
  <pre><code>5.8 Sunny 01/23/2016 Seattle Washington
  25.7 Cloudy 03/04/2016 Chicago Illinois
  7 Snowy 12/20/2016 Tacoma Washington
  3 Windy 04/5/2016 Los Angeles California
  </code></pre>
  
  <p>So let's say in this case I wanted to only print the dates, weather conditions, and the state while ignoring the city and numerical numbers as well as organizing it by state, I was wondering exactly how I would do this. </p>
  
  <p>Personally I was thinking of doing a .split(' ') function though I don't think would work because the last line has 6 words while the others have 5. I was also thinking of maybe making a set in order to organize by state maybe? I'm a still a bit confused about the process. Thank you.</p>
  
  <p>EDIT: This is what I have now. So this does return the specific words I want. </p>
  
  <pre><code>file = open('word.txt')
  for line in file:
      weather = line.split(' ')[1]
      date = line.split(' ')[2]
      state = line.split(' ')[-1]
  
  
  print(weather)
  print(date)
  print(state)
  </code></pre>
  
  <p>EDIT 2: This was my attempt at the organization. However, it doesn't quite work.</p>
  
  <pre><code>file = open('word.txt')
      for line in file:
          weather = line.split(' ')[1]
          date = line.split(' ')[2]
          state = line.split(' ')[-1]
  
  
          setlist1 = []
          setlist2 = []
  
          if state == state:
              setlist2.append(state)        
              setlist1.append(date)
              setlist1.append(weather)
              setlist2.append(setlist1)
  
          print(setlist2)
  </code></pre>