<jupyter_start><jupyter_text>Challenge 008 - Longest WordThis challenge is taken from CoderByte - Longest Word (https://coderbyte.com/information/Longest%20Word). ProblemHave the function LongestWord(sen) take the sen parameter being passed and return the longest word in the string. If there are two or more words that are the same length, return the first word from the string with that length. Ignore punctuation and assume sen will not be empty. Words may also contain numbers, for example "Hello world123 567"Examples```Input: "fun&!! time"Output: time``````Input: "I love dogs"Output: love``` Solution<jupyter_code>import string

def LongestWord(sen):
    # split sen with delimiter ' '
    words = sen.split(' ')

    # remove punctuation inside word in words 
    for i in range(len(words)):
        words[i] = words[i].strip(string.punctuation)

    # find the longest word in words
    longest = ''
    for word in words:
        if len(word) > len(longest):
            longest = word

    return longest

# keep this function call here 
print(LongestWord(input()))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09041591320072333, 'fraction_numerical': 0.009945750452079566, 'mean_word_length': 4.031818181818182, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '539364', 'license': 'MIT', 'n_tokens_mistral': 324, 'n_tokens_neox': 307, 'n_words': 124, 'path': 'challenges/008-Longest_Word/008-Longest_Word.ipynb', 'repo_name': 'jfdaniel77/interview-challenge', 'size': '1106'}