I tried this:
sentence = input("Sentence without punctuation: ") lst = [sentence] longestString = max(lst, key=len) print(longestStri