Your problem is fundamentally in this loop:
for bid in bids: bid = int(bid)
The above does not change the contents of bids . It creates new whole instances called bid every time with which you do nothing. Therefore, when you later move on to sorting bids , you just sort the original string elements, not the integers.
If you want to sort integer values, you have several options. One of them is to convert values to integers when they enter:
bids.append(int(bid))
One of them is converting and sorting in your print path:
for bid in sorted((int(x) for x in bids), reverse=True): print(bid)
Since the approach you seem to want to take is to replace bids string elements with whole elements instead, you probably want to do something like your original loop, but don't throw away the results:
intbids = [] for bid in bids: intbids.append(int(bid))
Many people will tell you that the above is more succinctly written as
intbids = [int(bid) for bid in bids]
I used intbids as a separate list to make it clear what is going on. If you just want to throw away the line bet list as soon as you have an integer bet list, you can just use the same name:
bids = [int(bid) for bid in bids]
If it is really really important to replace each element “in place” (this means that a new list is not being created), then the most simple way to understand is probably the index cycle:
for i in range(len(bids): bids[i] = int(bids[i])
(But until you are very experienced and work with tons and tons of data, my strong recommendation is not to worry about “updating lists in place.” It's not as natural as writing Python.)