-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauction.py
More file actions
55 lines (39 loc) · 1.27 KB
/
Copy pathauction.py
File metadata and controls
55 lines (39 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import os
print('''
___________
\ /
)_______(
|"""""""|_.-._,.---------.,_.-._
| | | | | | ''-.
| |_| |_ _| |_..-'
|_______| '-' `'---------'` '-'
)"""""""(
/_________\\
.-------------.
/_______________\\
''')
bids={}
bidding_finished=False
def find_highest_bidder(bidding_record):
highest_bid=0
winner=""
for bidder in bidding_record:
bid_amount=bidding_record[bidder]
if bid_amount>highest_bid:
highest_bid=bid_amount
winner=bidder
print(f"The winner is {winner} with a bid of {highest_bid}")
while not bidding_finished:
name=input("Enter the name of the bidder: ")
bid_price=int(input("Enter the bid price: "))
bids[name]=bid_price
should_continue=input("Are there any other bidders? Type 'yes' or 'no':")
if should_continue=="no":
bidding_finished=True
find_highest_bidder(bids)
elif should_continue=="yes":
def clear_screen():
os.system('cls')
clear_screen()
else:
print("Wrong Input")