Re: [Tutor] sorting algorithim

2009-04-24 Thread Alan Gauld
"tonyon boyo" wrote i know how to print for bubble sort in python, is there a way to print each pass in the sort so i can see what happens at each step? thanks Yes add a print statement inside the looop that prints the list being sorted. def bubblesort(list): for passes in range(len

Re: [Tutor] sorting algorithim

2009-04-23 Thread R. Alan Monroe
> i know how to print for bubble sort in python, is there a way to > print each pass in the sort so i can see what happens at each step?  > thanks A good first guess would be to try sticking "print list" in there in a few different places. Others will probably point out that "list" is a built-in

[Tutor] sorting algorithim

2009-04-23 Thread tonyon boyo
hello,   i know how to print for bubble sort in python, is there a way to print each pass in the sort so i can see what happens at each step?  thanks   def bubblesort(list):     for passes in range(len(list)-1, 0, -1):     for index in range(passes):     if list[index] < list[index + 1