私は日付を取得するプログラムを作ろうとしています。Python - 曜日名を使用してリストからアイテムを取得する
import datetime
def getdate():
now = datetime.datetime.now()
print(now.strftime("%A"))
day=getdate()
##LESSON LIST###
################
Lessons = [
Monday=['English','Geography','German','P.E.','Science-C']
Tuesday=['Art','Science-B','Maths','ICT','French']
Wednesday=['History','English','Drama','Science-B','Maths']
Thursday=['P.E.','D&T','HTT','Geography','R.E.']
Friday=['German','D&T','Maths','English','Music']
]
################
#END LESSON LIST
Today = Lessons[day]
print("1) Book Check")
print("2) Timetable List")
x = input()
if x = 1:
#List lessons for this day one by one with a book input eg.
print("book for lesson1")
l1 = bool(input("True/False"))
print("book for lesson2")
l2 = bool(input("True/False"))
#but it should say the lesson name, and save the state of book boolean
elif x = 2:
#list lessons for this day
print(Today) # just an example.
現在のところ、私は修正できない構文エラーがあります。私はどこに間違っていたのかわかりません。コードを完成させるために辞書を使いたいのですが、どうすればよいか分かりません。
コードに問題がありますか? – glibdud
あなたの質問は何ですか? –
あなたの質問は何ですか? –