Skip to main content
edited body
Source Link

The problem is that when reading the csv file, you get strings. Then, the bubble sort is doing lexicographical sorting and not the numerical sort you are looking for.

To fix it typecast the score into int (assuming the pointsscores are integers) as follows

score = int(row[1]) 

and then it should work properly.

The problem is that when reading the csv file, you get strings. Then, the bubble sort is doing lexicographical sorting and not the numerical sort you are looking for.

To fix it typecast the score into int (assuming the points are integers) as follows

score = int(row[1]) 

and then it should work properly.

The problem is that when reading the csv file, you get strings. Then, the bubble sort is doing lexicographical sorting and not the numerical sort you are looking for.

To fix it typecast the score into int (assuming the scores are integers) as follows

score = int(row[1]) 

and then it should work properly.

Source Link

The problem is that when reading the csv file, you get strings. Then, the bubble sort is doing lexicographical sorting and not the numerical sort you are looking for.

To fix it typecast the score into int (assuming the points are integers) as follows

score = int(row[1]) 

and then it should work properly.