Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
703 B
1
Indexable
Never
from replit import clear
from art import logo

print(logo)
print("Welcome to the secret auction program.")

slownik = {}
winner = ""

def auction_function():
    name = input("What is your name?: ")
    bid = input("What is your bid?: $")
    other = input("Are there any other bidders? Type 'yes' or 'no'. ")
    slownik[name] = bid
    biggest_bid = 0
    for k, v in slownik.items():
        if int(v) > biggest_bid:
            slownik[k] = v
            biggest_bid = int(v)
            winner = k   
    if other == 'yes':
        clear()
        auction_function()
    elif other == 'no':
        clear()
        print(f"The winner is {winner} with a bid of ${biggest_bid}!")


auction_function()