物品：[{name: "椅子", quantity: 4, price: 20}, {name: "桌子", quantity: 1, price: 100}, {name: "灯", quantity: 2, price: 45}]
设计一个函数用于Web应用程序，计算给定数量物品的总成本。
def calculateTotalCost(items):
    total_cost = 0
    for item in items:
        total_cost += item['quantity'] * item['price']
    return total_cost