Made an epic showcase website and API!
This commit is contained in:
parent
9e21e4dbdd
commit
1907fad7c5
89 changed files with 36444 additions and 3 deletions
25
projects/Day 9/secret-auction.py
Normal file
25
projects/Day 9/secret-auction.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
from art import logo
|
||||
|
||||
print(logo)
|
||||
print("Welcome to the secret auction program.")
|
||||
|
||||
bid_dict = {}
|
||||
def new_bid():
|
||||
name = input("What is your name?: ")
|
||||
bid = input("What's your bid?: $")
|
||||
bid = float(bid)
|
||||
bid_dict[name] = bid
|
||||
end_check = input("Are there any other bidders? Type 'yes' or 'no'.")
|
||||
if end_check == "yes":
|
||||
new_bid()
|
||||
elif end_check == "no":
|
||||
highest_bid = bid
|
||||
highest_bidder = name
|
||||
for bidder in bid_dict:
|
||||
if bid_dict[bidder] > highest_bid:
|
||||
highest_bid = bid_dict[bidder]
|
||||
highest_bidder = bidder
|
||||
print(f"The winner is {highest_bidder} with a bid of ${highest_bid}.")
|
||||
return
|
||||
|
||||
new_bid()
|
||||
Loading…
Add table
Add a link
Reference in a new issue