# initializing variables
sentence = ""
longest_word = ""
longest_length = 0
#main loop
while True:
#ask user to input a sentence
sentence = input("Enter a sentence: ")
#split the sentence into a list of words
words = sentence.split()
#iterate through the list of words
for word in words:
#check word length and compare to current longest length
if len(word) > longest_length:
#if the current word is longer, update variables
longest_word = word
longest_length = len(word)
#print out word count and longest word/length
print(f"Word count: {len(words)}")
print(f"Longest word: {longest_word} ({longest_length} characters)")
#ask user if they would like to enter another sentence
choice = input("Enter another sentence? (y/n) ")
if choice.lower() == 'n':
break