title: Python how to break
body: <p>I have a code down here with try and catch and i want to break the code when the user write in exit
  with the Kard variable but i tried to compare it but it failed!</p>
  <pre><code>print(&quot;MATHLETE 2.0&quot;)
  print(&quot;-------------&quot;)
  
  #Variabler
  kard = 0
  summan = 0
  medel = 0
  #svar = 'exit'
  i = 0
  
  while True:
  
      
  
      kard += 1
      summan = summan + kard
      try:
          kard = int(input(&quot;&gt; &quot;))
          
      except ValueError:
          if str(kard) == 'exit':
              break
          else:
              print(&quot;Fel - Ogiltigt Nummer&quot;)
              print(&quot;-------------&quot;)
          
         
          
  summan = summan + kard
      
  print(&quot;-------------&quot;)
  print(&quot;Kardinalitet: &quot;, kard)
  print(&quot;Summan: &quot;, summan)
  print(&quot;Medelvärde: &quot;, medel)
  </code></pre>