2024-01-01

Blind Auction code in Python

from replit import clear
#HINT: You can call clear() to clear the output in the console.
from art import logo
print(logo)

bid_list = {}
more_bidder = "yes"
high_amount = 0
while more_bidder == "yes":
    name = input("What is your name?: ")
    amount = int(input("What is your bid?: $"))
    bid_list[name] = amount
    more_bidder = input("Are there any other bidders? Type 'yes' or 'no'.\n")
    if more_bidder == "yes":
        clear()

for name in bid_list:
    if bid_list[name] > high_amount:
        high_bidder = name
        high_amount = bid_list[name]

print(f"The winner is {high_bidder} with a bid of ${high_amount}")
print(bid_list)