-
Notifications
You must be signed in to change notification settings - Fork 684
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c90b8d6
commit 28791d2
Showing
2 changed files
with
24 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ | |
/_________\\ | ||
.-------------. | ||
/_______________\\ | ||
''' | ||
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
|
||
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() |