僅供參考
from datetime import datetime
def code_save_on_ithelp(data: str):
birthday = datetime.strptime(data, "%Y%m%d")
result = ""
if 10 <= birthday.month <= 12:
result += "科學麵"
if birthday.day % 2 != 0:
result += "飲料" if not result else "+飲料"
if result == "":
result = 0
return result
if __name__ == '__main__':
input_data = input("請輸入出生日期:")
print(code_save_on_ithelp(data=input_data))