Beginner
Print a neat price row
You have name = "Asha", price = 1234.5 and qty = 3. Print one line with an f-string, laid out as three parts separated by |:
the name left-aligned in 8 characters, the price right-aligned in 10 characters with a thousands separator and two decimals, and x followed by the quantity. The line must be exactly Asha | 1,234.50|x3.
What Check tests
- The printed line is
Asha | 1,234.50|x3 - The program prints exactly one line
- The row is built with an f-string
name,priceandqtyare unchanged
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
main.py
Sign in to run your code.
Output
Press Run to see what your program prints.