Skip to main content

Command Palette

Search for a command to run...

2024-01-01

Updated

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)

More from this blog

达客宁

171 posts

江南有佳丽 生于帝王州 繁花未曾见 王谢纸上闻

茕茕影孑立 烟雨两凄迷 凭栏望楼台 四百寺安在

2024-01-01