diff --git a/Day 9/art.py b/Day 9/art.py new file mode 100644 index 0000000..baff1f9 --- /dev/null +++ b/Day 9/art.py @@ -0,0 +1,13 @@ +logo = ''' + ___________ + \ / + )_______( + |"""""""|_.-._,.---------.,_.-._ + | | | | | | ''-. + | |_| |_ _| |_..-' + |_______| '-' `'---------'` '-' + )"""""""( + /_________\\ + .-------------. + /_______________\\ +''' \ No newline at end of file diff --git a/Day 9/secret-auction.py b/Day 9/secret-auction.py new file mode 100644 index 0000000..720db43 --- /dev/null +++ b/Day 9/secret-auction.py @@ -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() \ No newline at end of file