← All Python interview questions
Total campaign revenue from prices and quantities
EasyLists & LoopsFlipkartMeesho
Marketing sends you two parallel lists: the unit price of each item sold in a campaign and the quantity sold. You need one revenue number for the campaign report.
Write a function total_revenue(prices, quantities) that multiplies each price by the quantity at the same position, sums the results, and returns the total as a float rounded to 2 decimals.
More Lists & Loops questions
- This is the only question on this topic for now.
Asked at Flipkart
Practising alone only goes so far — our live cohorts pair Python and Pandas depth with dashboards, agentic analytics projects and mock interviews.
Explore the program