34. Python Program to Print a Shopping Bill with Variables
HardTypes
Overview
Put the whole chapter together: variables, calculations and types, in one small program.
Problem Statement
A shop sells pens at 10 each and notebooks at 45 each. Sunny buys 3 pens and 2 notebooks and pays by card.
Store every price, quantity and the payment method in variables, calculate the totals with those variables (don't type the answers yourself), and print this bill. The columns are separated by tabs (\t):
Item Qty Total
Pen 3 30
Notebook 2 90
Grand total 120
Paid by card: True
Input
No input is required for this question.
Output
The 5 lines above, with a tab between the columns and two tabs before 120.