Blind Auction Application: Python Project
Introduction: Blind Auction is a very simple python project, suitable for python beginners. It has very simple logic, the user will input as many as a bidder and their price and program will compare their bidding price and shows up the highest bidder as a winner.
Code:
main.py
from replit import clear
#HINT: You can call clear() to clear the output in the console.
from art import logo
print(logo)
name_add = True
dictionary = {}
price_list = []
name_list = []
while name_add is not False:
name = input("What is your name?\n")
price = input("What is your bid price?\n")
name_list.append(name)
price_list.append(price)
clear()
is_another = input("Do you want to add another bidder? Y or N\n").lower()
if is_another != "y":
name_add = False
clear()
dictionary["name"] = name_list
dictionary["bid"] = price_list
max_price = max(dictionary["bid"])
print(f"Winner is: {(dictionary['name'][dictionary['bid'].index(max_price)])}")
art.py
logo = '''
___________
\ /
)_______(
|"""""""|_.-._,.---------.,_.-._
| | | | | | ''-.
| |_| |_ _| |_..-'
|_______| '-' `'---------'` '-'
)"""""""(
/_________\\
.-------------.
/_______________\\
'''
Comments
Post a Comment