为什么此代码无法与有效的内存一起使用[关闭]

问题描述 投票:-1回答:1

我需要更多有关如何改进代码以减少内存的信息

def rental_car_cost(days):
    cost = 40 *days
    if days >= 7 :
         cost += 50
    elif days >= 3:
         cost +=  20
    else:
        return cost
rental_car_cost(7)
python function if-statement space-complexity
1个回答
1
投票

有两个错误,首先,您应该减少

© www.soinside.com 2019 - 2024. All rights reserved.