words = [
{"word": "Hello", "translation": "你好", "example": "Hello! How are you?"},
{"word": "Thank you", "translation": "謝謝", "example": "Thank you for your help."},
{"word": "Goodbye", "translation": "再見", "example": "Goodbye! See you tomorrow."},
{"word": "Please", "translation": "請", "example": "Please pass me the salt."},
]
def display_words():
print("每日單詞列表:")
for i, word in enumerate(words, start=1):
print(f"{i}. {word['word']} - {word['translation']}")
def show_word_details(index):
if 0 <= index < len(words):
word = words[index]
print("\n單詞詳情:")
print(f"單詞:{word['word']}")
print(f"翻譯:{word['translation']}")
print(f"例句:{word['example']}\n")
else:
print("\n無效的索引,請重試。\n")
def main():
while True:
print("\n歡迎使用語言學習程式!")
print("1. 查看每日單詞")
print("2. 選擇單詞查看詳情")
print("3. 離開程式")
choice = input("請選擇功能 (1/2/3):")
if choice == "1":
display_words()
elif choice == "2":
try:
word_index = int(input("請輸入單詞編號 (1-4):")) - 1
show_word_details(word_index)
except ValueError:
print("\n請輸入有效的數字。\n")
elif choice == "3":
print("感謝使用,再見!")
break
else:
print("\n無效選擇,請重試。\n")
if __name__ == "__main__":
main()
d29yZHMgPSBbCiAgICB7IndvcmQiOiAiSGVsbG8iLCAidHJhbnNsYXRpb24iOiAi5L2g5aW9IiwgImV4YW1wbGUiOiAiSGVsbG8hIEhvdyBhcmUgeW91PyJ9LAogICAgeyJ3b3JkIjogIlRoYW5rIHlvdSIsICJ0cmFuc2xhdGlvbiI6ICLorJ3orJ0iLCAiZXhhbXBsZSI6ICJUaGFuayB5b3UgZm9yIHlvdXIgaGVscC4ifSwKICAgIHsid29yZCI6ICJHb29kYnllIiwgInRyYW5zbGF0aW9uIjogIuWGjeimiyIsICJleGFtcGxlIjogIkdvb2RieWUhIFNlZSB5b3UgdG9tb3Jyb3cuIn0sCiAgICB7IndvcmQiOiAiUGxlYXNlIiwgInRyYW5zbGF0aW9uIjogIuiriyIsICJleGFtcGxlIjogIlBsZWFzZSBwYXNzIG1lIHRoZSBzYWx0LiJ9LApdCgpkZWYgZGlzcGxheV93b3JkcygpOgogICAgcHJpbnQoIuavj+aXpeWWruipnuWIl+ihqO+8miIpCiAgICBmb3IgaSwgd29yZCBpbiBlbnVtZXJhdGUod29yZHMsIHN0YXJ0PTEpOgogICAgICAgIHByaW50KGYie2l9LiB7d29yZFsnd29yZCddfSAtIHt3b3JkWyd0cmFuc2xhdGlvbiddfSIpCgpkZWYgc2hvd193b3JkX2RldGFpbHMoaW5kZXgpOgogICAgaWYgMCA8PSBpbmRleCA8IGxlbih3b3Jkcyk6CiAgICAgICAgd29yZCA9IHdvcmRzW2luZGV4XQogICAgICAgIHByaW50KCJcbuWWruipnuips+aDhe+8miIpCiAgICAgICAgcHJpbnQoZiLllq7oqZ7vvJp7d29yZFsnd29yZCddfSIpCiAgICAgICAgcHJpbnQoZiLnv7vora/vvJp7d29yZFsndHJhbnNsYXRpb24nXX0iKQogICAgICAgIHByaW50KGYi5L6L5Y+l77yae3dvcmRbJ2V4YW1wbGUnXX1cbiIpCiAgICBlbHNlOgogICAgICAgIHByaW50KCJcbueEoeaViOeahOe0ouW8le+8jOiri+mHjeippuOAglxuIikKCmRlZiBtYWluKCk6CiAgICB3aGlsZSBUcnVlOgogICAgICAgIHByaW50KCJcbuatoei/juS9v+eUqOiqnuiogOWtuOe/kueoi+W8j++8gSIpCiAgICAgICAgcHJpbnQoIjEuIOafpeeci+avj+aXpeWWruipniIpCiAgICAgICAgcHJpbnQoIjIuIOmBuOaTh+WWruipnuafpeeci+ips+aDhSIpCiAgICAgICAgcHJpbnQoIjMuIOmboumWi+eoi+W8jyIpCiAgICAgICAgY2hvaWNlID0gaW5wdXQoIuiri+mBuOaTh+WKn+iDvSAoMS8yLzMp77yaIikKCiAgICAgICAgaWYgY2hvaWNlID09ICIxIjoKICAgICAgICAgICAgZGlzcGxheV93b3JkcygpCiAgICAgICAgZWxpZiBjaG9pY2UgPT0gIjIiOgogICAgICAgICAgICB0cnk6CiAgICAgICAgICAgICAgICB3b3JkX2luZGV4ID0gaW50KGlucHV0KCLoq4vovLjlhaXllq7oqZ7nt6jomZ8gKDEtNCnvvJoiKSkgLSAxCiAgICAgICAgICAgICAgICBzaG93X3dvcmRfZGV0YWlscyh3b3JkX2luZGV4KQogICAgICAgICAgICBleGNlcHQgVmFsdWVFcnJvcjoKICAgICAgICAgICAgICAgIHByaW50KCJcbuiri+i8uOWFpeacieaViOeahOaVuOWtl+OAglxuIikKICAgICAgICBlbGlmIGNob2ljZSA9PSAiMyI6CiAgICAgICAgICAgIHByaW50KCLmhJ/orJ3kvb/nlKjvvIzlho3opovvvIEiKQogICAgICAgICAgICBicmVhawogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHByaW50KCJcbueEoeaViOmBuOaTh++8jOiri+mHjeippuOAglxuIikKCmlmIF9fbmFtZV9fID09ICJfX21haW5fXyI6CiAgICBtYWluKCk=