Amazon Seller Net Revenue

Easy
Arithmetic
E-commerce
Amazon

Amazon Seller Net Revenue

An Amazon-style marketplace team calculates seller revenue after marketplace fees.

Return seller_id, net_revenue, where net revenue is gross_revenue * (1 - fee_pct / 100), rounded to 2 decimal places. Sort by seller_id ascending.

Browser Engine: Evaluates PySpark DataFrame & SQL logic locally in Pyodide WebAssembly.

Input data

1 DataFrame

These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].

df.seller_sales6 rows
seller_id (string)seller_name (string)gross_revenue (double)fee_pct (double)
S1TechNest5000015
S2HomeHarbor3200012
S3FitGear1800018
S4BookBay250008
S5KitchenKing4200015
S6PetPalace2750010

Return these columns

seller_id(string)
net_revenue(double)

Column names and order must match. Sort order is specified in the question.

Browser engine
Loading Python editor…
Click Run to try the sample cases, or Submit to check the hidden cases. First run caches the browser Python engine (~8–15s once); all code stays on your device.