Prevent an overwriting a value in dictanery in Python

Viewed 30

How to prevent the overwriting of a value in dictionary in python and check the highest value in the same dictionary

is_other_user=True
while is_other_user:
  name = input("Enter your name please: ")
  bid= int(input("Enter your bid price please: "))
  def auction(user_name,user_bid):
    auction_info={}
    auction_info[user_name]=user_bid
            
  other_user=input("Is there other users who want to bit 'yes' 'no' ")
  if other_user=="no":
    is_other_user=False
    auction(name,bid)
    print("Goodbye")
  else:
    auction(name,bid)`
0 Answers
Related