title: How to swap maximums with the minimums? (python)
body: <p>Is there a method to swap the maximum and the minimum of a list? </p>
  
  <p>The list will be as follows and the program has to be continued so that it will print the maximum swapped with the minimum, the second maximum swapped with the second minimum and third maximum swapped with the third minimum.</p>
  
  <p>Eg. Enter input- 0 1 2 3 4 5 6 7 8 9 -1
  Output- 9873456210</p>
  
  <pre><code>a = []
  nums = raw_input("Enter input- ")
  for n in nums.split():
      n = int(n)
      if n &lt; 0:
          break
      a.append(n)
  if len(a)&lt;7:
      print "please enter more than 7 integers"
  </code></pre>