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.
////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)
///Error///
this is the error message Line 2: Syntax Error: bad input (' ')