From 28791d2bb9090c4e6a85c4a726b8ddea9e9921ee Mon Sep 17 00:00:00 2001 From: Lint Action Date: Sun, 11 Aug 2024 13:46:20 +0000 Subject: [PATCH] Fix code style issues with Black --- projects/Blind Auction/art.py | 2 +- projects/Blind Auction/main.py | 43 ++++++++++++++++++---------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/projects/Blind Auction/art.py b/projects/Blind Auction/art.py index 46fc0eca..3031d9c3 100644 --- a/projects/Blind Auction/art.py +++ b/projects/Blind Auction/art.py @@ -10,4 +10,4 @@ /_________\\ .-------------. /_______________\\ -''' \ No newline at end of file +''' diff --git a/projects/Blind Auction/main.py b/projects/Blind Auction/main.py index 5d18f509..b3124e76 100644 --- a/projects/Blind Auction/main.py +++ b/projects/Blind Auction/main.py @@ -1,31 +1,34 @@ from replit import clear -#HINT: You can call clear() to clear the output in the console. + +# HINT: You can call clear() to clear the output in the console. from art import logo + print(logo) bids = {} bidding_finished = False + def find_highest_bidder(bidding_record): - highest_bid = 0 - winner = "" - for bidder in bidding_record: - bid_amount = bidding_record[bidder] - if bid_amount > highest_bid: - highest_bid = bid_amount - winner = bidder - print(f"The winner is {winner} with a bid of ${highest_bid}.") + highest_bid = 0 + winner = "" + for bidder in bidding_record: + bid_amount = bidding_record[bidder] + if bid_amount > highest_bid: + highest_bid = bid_amount + winner = bidder + print(f"The winner is {winner} with a bid of ${highest_bid}.") + while not bidding_finished: - name = input("What is your name? ") - bid = int(input("What is your bid? $")) - bids[name] = bid - - should_continue = input("Are there any other bidders? Type 'yes' or 'no': ").lower() - if should_continue == "no": - find_highest_bidder(bids) - bidding_finished = True - elif should_continue == "yes": - clear() - \ No newline at end of file + name = input("What is your name? ") + bid = int(input("What is your bid? $")) + bids[name] = bid + + should_continue = input("Are there any other bidders? Type 'yes' or 'no': ").lower() + if should_continue == "no": + find_highest_bidder(bids) + bidding_finished = True + elif should_continue == "yes": + clear()