Start New Discussion within our Software Development Community
# Accept a sentence
str=raw_input("Enter a sentence: ")

# Split the sentence at each space
split_str=str.split()

p=0
s=""

for item in split_str:
    if(len(item)>p):
        s=item
        p=len(item)

print("Longest word: "+s)
The article starter has earned a lot of community kudos, and such articles offer a bounty for quality replies.