Skip to content

Commit fb32f23

Browse files
committed
ren variables
1 parent 181b7ee commit fb32f23

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

06-map-filter-reduce/mfr10.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
items_on_special = filter(lambda item: item.on_special, shopping_list)
1313

1414
# Create a list of prices and use `reduce()` to add them up
15-
prices_of_items_on_special = list(item.price for item in items_on_special)
16-
specials_only_total = reduce(lambda x, y: x + y, prices_of_items_on_special)
15+
specials_prices = list(item.price for item in items_on_special)
16+
specials_total = reduce(lambda x, y: x + y, specials_prices)
1717

18-
savings = total - specials_only_total
18+
savings = total - specials_total
1919

2020
print(" -- but if you just bought things that were on special, it'd be ", end="")
21-
print(f"${specials_only_total:.2f} (saving you ${savings:.2f}).")
21+
print(f"${specials_total:.2f} (saving you ${savings:.2f}).")

0 commit comments

Comments
 (0)