Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- def cls():
- os.system('cls' if os.name == 'nt' else 'clear')
- dictionary_auction = {}
- list_of_bids = []
- more_users = True
- while more_users == True:
- name = input("Give your name please : \n")
- bid = int(input("Give me your bid please: \n"))
- new_bidder = input("Is there any other bidder? \n")
- if new_bidder == "yes":
- cls()
- else:
- more_users = False
- dictionary_auction[name] = bid
- list_of_bids.append(bid)
- highest_bid = max(list_of_bids)
- print(dictionary_auction)
- print(list_of_bids)
- print(highest_bid)
- for name, bid in dictionary_auction.items():
- if bid == highest_bid:
- winner = name
- print(f"the winner is : {winner}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement