title: how to check if a word is in alphabetical order in python
body: <p>So i'm trying to do this python program that will print if a word is in alphabetical order or not. I'm new to python. I don't really know much. I tried to gather up this program but it has some errors.</p>
  
  <p>////Code////</p>
  
  <pre><code> b = "hello world"
   words = b.split()
   i = b.split()
   # sort the list
   words.sort()
   for word in i:
   i.append(word)
   if i == words:
   print(True)
   else:
   print(False)
  </code></pre>
  
  <p>///Error///</p>
  
  <p>this is the error message 
  Line 2: Syntax Error: bad input (' ')</p>