小编Sam*_*art的帖子

在 Zapier 中使用此代码时,为什么会出现 Runtime.MarshalError?

以下代码给了我:

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'

python zapier

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

python ×1

zapier ×1