Silent Bidder dict python
from replit import clear
from art import logo
#HINT: You can call clear() to clear the output in the console.
print(logo)
bidders={}
a=input("What is your name : ")
b=int(input("whats your bid? : "))
bidders[a]=b
c=input("Any more bidders : ").lower()
clear()
while(c=='yes'):
a=input("What is your name : ")
b=int(input("whats your bid? : "))
bidders[a]=b
c=input("Any more bidders : ").lower()
clear()
index=""
max=0
for key in bidders:
if bidders[key]>max:
max=bidders[key]
index=key
print("The winner is "+index+" with bid of "+str(max))
Comments
Post a Comment