以下代码给了我:
Runtime.MarshalError:无法编组响应:{'Yes'} 不是 JSON 可序列化的
from calendar import monthrange
def time_remaining_less_than_fourteen(year, month, day):
a_year = int(input['year'])
b_month = int(input['month'])
c_day = int(input['day'])
days_in_month = monthrange(int(a_year), int(b_month))[1]
time_remaining = ""
if (days_in_month - c_day) < 14:
time_remaining = "No"
return time_remaining
else:
time_remaining = "Yes"
return time_remaining
output = {time_remaining_less_than_fourteen((input['year']), (input['month']), (input['day']))}
#print(output)
Run Code Online (Sandbox Code Playgroud)
当我删除 {...} 它然后抛出:'unicode' object has no attribute 'copy'