23. Python Program to Calculate and Format a Total Cost
MediumStrings
Overview
Format output using variables.
Problem Statement
Calculate and format a product's total cost.
Constraints:
- Use
product = "Apple",price = 0.99,quantity = 5 - Calculate total cost (price × quantity)
- Format output as: "5 Apples cost $4.95"
Input
- No input required
Output
5 Apples cost $4.95