DEV Community

Cover image for My #100daysOfCode Challenge - Python 100 projects in 100 days - Journal Entries - Day 9
Anthony Beckford🚀
Anthony Beckford🚀

Posted on

2

My #100daysOfCode Challenge - Python 100 projects in 100 days - Journal Entries - Day 9

Day 9 - Silent Auction Program

I'm back with 100daysofPython!
Learned about Dictionaries and Nesting in Python

logo = '''
___________
\ /
)____(
|"""""""|
.-.,.---------.,.-._
| | | | | | ''-.
| || | | |..-'
|
__| '-' '---------' '-'
)"""""""(
/
___\
.-------------.
/
____________\
'''

from replit import clear

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}")

while not bidding_finished:
name = input("What is your name?: ")
price = int(input("What's your bid?: "))
bids[name] = price
should_continue = input("Are there any other bidder? Type 'yes' or 'no' ")
if should_continue == 'no':
bidding_finished = True
find_highest_bidder(bids)
elif should_continue == 'yes':
clear()

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay