title: How to Stop Reading Input After a Certain Character?
body: <p>I'm meant to stop reading an input after a "!" appears. This is part of my code:</p>
  
  <pre><code>msg = input("What is your message? ")
  
  print()
  
  lett = 0
  otherch = 0
  num_vowels = 0
  num_consanants = 0
  
  count_character = [0] * 100000
  
  for character in msg.upper():
      if character == "!":
          print("lett =", lett)
          print("other char = ", otherch)
          print("num_vowels = ", num_vowels)
          print("num_consanants = ", num_consanants)
      elif character &lt; "A" or character &gt; "Z":
          otherch = otherch + 1
          count_character[ord(character)] = count_character[ord(character)] + 1
      else:
          lett = lett + 1
          count_character[ord(character)] = count_character[ord(character)] + 1
  for character in msg.upper():
          print("character", character, "appeared" , count_character[ord(character)] , "times")
  </code></pre>
  
  <p>However, if i run the program and input something such as "hello!hi" it continues to read the text after the exclamation point and goes on to say that there are two H's and one I in the input.
  Any helpers?</p>