Use map() with multiple lists Dry Run in PYTHON

Use map() with multiple lists is an interactive PYTHON dry run visualizer from the Special programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

Use map() with multiple lists Program Code

# Element-wise operations on multiple lists
prices = [100, 200, 300, 400]
quantities = [5, 3, 2, 4]
discounts = [10, 15, 5, 20]

# Calculate final price: (price * quantity) - discount
final_prices = list(map(lambda p, q, d: (p * q) - d, prices, quantities, discounts))

print("Prices:", prices)
print("Quantities:", quantities)
print("Discounts:", discounts)
print("Final prices:", final_prices)

View the complete Special programs page.

Program Console Use map() with multiple lists Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.