# list of the cost of fruits in pence list = [("apple", 55), ("orange", 60), ("pineapple", 140), ("lemon", 80)] product =[ price for fruit, price in list] print(sum(product)) как это - [price for fruit, price in list] работает?
# list of the cost of fruits in pence list = [("apple", 55), ("orange", 60), ("pineapple", 140), ("lemon", 80)] product =[ price for fruit, price in list] print(sum(product)) как это - [price for fruit, price in list] работает?
product =[ price for fruit, price in list]
product = [] for fruit, price in list: product.append(price)