Skip to content

Commit ab69f78

Browse files
authored
Add files via upload
1 parent 9e99d89 commit ab69f78

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

Blind Auction.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import os
2+
3+
logo = """
4+
,.ood888888888888boo.,
5+
.od888P^"" ""^Y888bo.
6+
.od8P'' ..oood88888888booo. ``Y8bo.
7+
.odP'" .ood8888888888888888888888boo. "`Ybo.
8+
.d8' od8'd888888888f`8888't888888888b`8bo `Yb.
9+
d8' od8^ 8888888888[ `' ]8888888888 ^8bo `8b
10+
.8P d88' 8888888888P Y8888888888 `88b Y8.
11+
d8' .d8' `Y88888888' `88888888P' `8b. `8b
12+
.8P .88P """" """" Y88. Y8.
13+
88 888 888 88
14+
88 888 888 88
15+
88 888. .. .. .888 88
16+
`8b `88b, d8888b.od8bo. .od8bo.d8888b ,d88' d8'
17+
Y8. `Y88. 8888888888888b d8888888888888 .88P' .8P
18+
`8b Y88b. `88888888888888 88888888888888' .d88P d8'
19+
Y8. ^Y88bod8888888888888..8888888888888bod88P^ .8P
20+
`Y8. ^Y888888888888888LS888888888888888P^ .8P'
21+
`^Yb., `^^Y8888888888888888888888P^^' ,.dP^'
22+
`^Y8b.. ``^^^Y88888888P^^^' ..d8P^'
23+
`^Y888bo., ,.od888P^'
24+
"`^^Y888888888888P^^'" LS
25+
"""
26+
27+
def clear():
28+
os.system('cls' if os.name == 'nt' else 'clear')
29+
30+
def highest_bidder(bidding_dictionary):
31+
# Find the bidder with the maximum bid
32+
richest_bidder = max(bidding_dictionary, key=bidding_dictionary.get)
33+
highest_bid = bidding_dictionary[richest_bidder]
34+
print(f"The winner is {richest_bidder} with a bid of ${highest_bid}.")
35+
36+
bids = {}
37+
more_bidders = True
38+
39+
while more_bidders:
40+
print(logo)
41+
name = input("What's your name? ")
42+
price = int(input("How much do you wanna bid? $"))
43+
bids[name] = price
44+
45+
should_continue = input("Are there any more bidders? Y/N: \n").upper()
46+
if should_continue == "N":
47+
more_bidders = False
48+
highest_bidder(bids)
49+
elif should_continue == "Y":
50+
clear()

0 commit comments

Comments
 (0)