Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1차과제_2 #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions question_board.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
total_list = []
while True:
question = input("질문을 입력해주세요 : ")
if question == "q":
break
else:
total_list.append({"질문" : question, "답변" : ""})


for i in total_list:
print(i["질문"])
answer = input("답변을 입력해주세요 : ")
i["답변"] = answer
print(total_list)
35 changes: 35 additions & 0 deletions todaysmenu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import random
import time

lunch = ["된장찌개", "피자", "제육볶음", "짜장면"]

while True:
print(lunch)
item = input("음식을 추가 해주세요 : ")
if(item == "q"):
break
else:
lunch.append(item)
print(lunch)

set_lunch = set(lunch)
while True:
print(set_lunch)
item = input("음식을 삭제해주세요 : ")
if(item == "q"):
break
else:
set_lunch = set_lunch - set([item])

print(set_lunch, "중에서 선택합니다.")
print("5")
time.sleep(1)
print("4")
time.sleep(1)
print("3")
time.sleep(1)
print("2")
time.sleep(1)
print("1")
time.sleep(1)
print(random.choice(list(set_lunch)))