Array arithmetic (element-wise)
📖 Scenario: You work in a small shop that tracks daily sales of two products. You want to quickly find the total sales each day by adding the sales of both products.
🎯 Goal: Build a simple program that creates two lists of daily sales numbers, then adds them element-wise to find total daily sales.
📋 What You'll Learn
Create two lists named
sales_product_a and sales_product_b with exact daily sales numbersCreate a variable named
days to store the number of daysUse a
for loop with index variable i to add sales element-wiseStore the element-wise sums in a list named
total_salesPrint the
total_sales list💡 Why This Matters
🌍 Real World
Shops and businesses often track daily sales of multiple products. Adding sales data element-wise helps find total sales per day quickly.
💼 Career
Data analysts and scientists frequently perform element-wise operations on arrays or lists to combine or compare data from different sources.
Progress0 / 4 steps