print("*"*18)
print("202606017나경문")
print("*"*18)
# 좌석 상태 출력 함수 정의
def show(seat_dict):
for seat in seat_dict:
print(seat, end="\t")
print()
for status in seat_dict.values():
print(f"|{status}|", end="\t")
print()
# 딕셔너리 초기화 (A0부터 A4)
seats = {}
for i in range(5):
key = f"A{i}"
seats[key] = "O"
# 예약 전 상태 출력 (함수 호출)
print("[현재 상태]")
show(seats)
#사용자 입력 및 좌석 상태 갱신
choice = input("좌석 입력:")
seats[choice] = "X"
# 예약 후 상태 출력 (함수 재호출)
print("\n[현재 상태]")
show(seats)
To embed this project on your website, copy the following code and paste it into your website's HTML: