title: How can I find the longest word in a string?
body: <p>Problem: I want the user to input a sentence (string) and use a loop to check which is the longest word to return.</p>
  
  <p>My solution:</p>
  
  <pre><code>string = input("Please enter a string ")
  new = string.split()
  max_length = 0
  max_word = ""
  
  for word in new:
      if len(word) &gt; max_length:
          max_length = len(word)
          max_word = word
  
  print("The longest word in the string is", max_word)
  </code></pre>
  
  <p>Question: How can I get printed <em>only</em> the largest word? </p>