My goal is to write code that allows people to place blind bids and then display the winner from the max value of the dictionary at the end. It works perfectly within inputs of the same digits (ex. 10 and 50, 100 and 500) but decides that 500 is the winner vs 1000, or 5000 is the winner against 11000. Im not sure why it decides the lower value is greater. I have tested a multitude of inputs and bids and it seems that each time you add another digit to the input it bugs.
def cls():
os.system('cls' if os.name=='nt' else 'clear')
bid_dict = {}
def winning():
while True:
winner = max(bid_dict, key=bid_dict.get)
price = max(bid_dict.values())
print(f'The winner is {winner} with a bid of ${price}')
print(bid_dict)
break
while True:
name = input("What is your name? ")
bid = input('What is your bid? ')
bid_dict[name] = bid
more = (input("Are there more bidders? ")).lower()
if more == "yes":
cls()
continue
else:
cls()
winning()