title: python while loop break
body: <p>I am trying to make an on/off switch for my program:
  (see after the <code>###</code> for what I'm talking about)</p>
  
  <pre><code>while 1:
      str = raw_input("insert your word: ")
      n = input("insert your scalar: ")
      def string_times(str, n):
          return n * str
      print string_times(str, n)
  
      ###
      def switch(on,off):
          raw_input("On or off? ")
          if switch == "on":
              continue
          if switch == "off":
              break
      switch(on,off)
  </code></pre>
  
  <p>I get a continue not in loop error.  Basically, I want to create an on or off switch after the program runs once.  What do I fix?</p>