title: How would I make this bubble sort more pythonic?
body: <p>I have this code:</p>
  <pre><code>Sorted=False
  while not Sorted:
      Sorted=True
      for x,y in enumerate(List[:-1]):
          if List[x]&gt;List[x+1]:
              List[x],List[x+1]=List[x+1],List[x]
              Sorted=False
  </code></pre>
  <p>However the use of</p>
  <pre><code>Sorted=True/False
  </code></pre>
  <p>being repeated is quite ugly and it would be much nicer to write the code is something similar to:</p>
  <pre><code>while True:
      for x,y in enumerate(List[:-1]):
          if List[x]&gt;List[x+1]:
              List[x],List[x+1]=List[x+1],List[x]
              break
      else:break
  </code></pre>
  <p>The only problem is that breaking from the loop this early causes the loop to be repeated many more times taking up more time overall. Are there any ways around this to make the code more pythonic or do I just need to leave it as ugly as it is?</p>