document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. def bubbleSort(myList2):
  2.     for i in range(len(myList2)):
  3.         for j in range((len(myList2)-1)):
  4.             if myList2[j] > myList2[j+1]:
  5.                 myList2[j],myList2[j+1] = myList2[j+1],myList2[j]
  6.  
  7.     return myList2
  8.  
  9. # main function
  10. print("Enter the array to be sorted : ")
  11. myList1 = list(map(int, input().strip().split(",")))
  12.  
  13. bubbleSort(myList1)
  14. print("The List after applying Bubble Sort is : ")
  15. print(myList1)
');