python (optimizing) bubble sort I saw in Wikipedia (the first under Optimizing bubble sort) a pseudo-code to bubble sort and I implemented it in Python.

I am posting my implementation here because I'm new to Python, and I'm looking mostly for programming in a more pythonic way. 

def bubbleSort(array):
    n = len(array)
    swapped = True
    while swapped:
        swapped = False
        for i in range(n - 1):
            if array[i] &gt; array[i + 1]:
                array[i], array[i + 1] = array[i + 1], array[i]
                swapped = True
        n -= 1
    return array


def main():
    array = [1, 7, 4, 3, 2, 9, 8, 5, 6]
    array = bubbleSort(array)
    print(array)

if __name__ == '__main__':
    main()


I'd love to know if there are any stuff that I can optimize (syntactic-wise), like the fact that I'm writing swapped = True, and afterward changing it again, and again ... which thing annoys me.
Also a beginner but one thing I would like to point out is naming function, Style Guide for Python Code states:


  Function Names
  Function names should be lowercase, with words separated by underscores as necessary to improve readability.
  
  mixedCase is allowed only in contexts where that's already the prevailing style (e.g. threading.py), to retain backwards compatibility.


So, in your case write bubble_sort instead of bubbleSort.