-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
41 lines (28 loc) · 750 Bytes
/
main.py
File metadata and controls
41 lines (28 loc) · 750 Bytes
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
from art import logo
import os
# author @aesha98
# secret auction program
bid_dict = {}
def clear():
os.system('clear')
def run_bid(name, bid):
bid_dict[name] = bid
highest_bid = 0
name_winner = None
for key_name,value_bid in bid_dict.items():
if (value_bid > highest_bid):
highest_bid = value_bid
name_winner = key_name
print(f"The winner is {name_winner} with bid of ${highest_bid}")
print(logo)
bid_end = False
while not bid_end:
name = input("what is your name?: ").lower()
bid = int(input("what is your bid?: $"))
other = input("Are there any other bidders? Type 'yes' or 'no'. ").lower()
if other == 'yes':
clear()
bid_dict[name] = bid
elif other == 'no':
run_bid(name=name, bid=bid)
bid_end = True