티스토리 뷰

from art import logo #텍스트 아트를 별도의 art.py에 logo 변수로 두고 읽어왔음
from replit import clear #화면 지우기의 일반적인 함수를 모르겠음
print(logo)
print("Welcome to the secret auction program.")
bidding = {}   #딕셔너리와 리스트/딕셔너리, 리스트간 무엇을 사용할지 결정하는데 시간소비함
repeat = True
while repeat:
    ones_name = input("What is your name?: ")
    ones_bid = int(input("What's your bid?: $"))
    bidding[ones_name] = ones_bid
    if input("Are there any other bidders? Type 'yes' or 'no'.") == "no":
        repeat = False
    else:
        clear()
max_bid = 0
for key in bidding:
    if bidding[key] > max_bid:
        winner_name = key
        max_bid = bidding[key]
print(f"The winner is {winner_name} with a bid of ${max_bid}.")
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/08   »
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
글 보관함