title: i want the program to accept a str value "exit" which would terminate the script
body: <p>in this program, variable SPAN accept int only. but i want it that once a user types exit, it terminate the code.</p>
  <pre><code>    while True:
          try:
              span = int(input('Enter number of span:'))
         except  ValueError:
              print(&quot;invalid input, please enter valid input&quot;)
          continue
      else:
          break
  
  while span &lt;= 1 or span &gt;= 5:
      print('Enter span range between 2-4')
      spann()
  
  if span == 2:
      span2()
  elif span == 3:
      span3()
  elif span == 4:
      span4()
  </code></pre>