← 返回题库
中级

存货加权平均法

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve(____):
    total_cost = beginning["____"] + sum(____)
    total_quantity = beginning["____"] + sum(____)
    avg_price = total_cost / total_quantity
    issued_cost = issued * avg_price
    ending_cost = total_cost - issued_cost
    return {"____": round(____), "____": round(____), "____": round(____)}

示例

输入
solve({"cost": 10000, "quantity": 100}, [{"cost": 22000, "quantity": 200}, {"cost": 16500, "quantity": 150}], 300)
期望输出
{'加权平均单价': 107.78, '发出成本': 32333.33, '期末成本': 16166.67}
Python 代码 🔒 登录后使用
🔒

登录后即可练习

注册免费账号,在浏览器中直接运行 Python 代码