JkSoftware

Day 9 - Exercise Silent Auction Program

Nov 13th, 2021 (edited)
138
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import auctionart
  2.  
  3. clearscr = lambda: print('\n' * 100)
  4.  
  5. print(auctionart.logo)
  6. print("Welcome to the silent auction program.")
  7.  
  8.  
  9. allbids = {}
  10.  
  11. def addbid():
  12.     usrname = input("What is your name? ")
  13.     usrbid = int(input("Whats your bid?"))
  14.     allbids[usrname] = usrbid
  15.     more_bids = input("Are there more bidders? Yes or No: ").lower()
  16.     if more_bids == "yes":
  17.         clearscr()
  18.         addbid()
  19.     else:
  20.         find_max_bid()
  21.        
  22.  
  23. def find_max_bid():
  24.     maxbidder = max(allbids)
  25.     print(f"{maxbidder} is the winner!")
  26.  
  27.  
  28. addbid()
  29.  
  30.  
RAW Paste Data Copied