LearnPy Hub
← Inheritance & Special Methods problems
Medium

Polymorphic Bill

Item has price(). Food(Item) adds 5% VAT, Book(Item) has no VAT, Electronics(Item) adds 15% VAT. Read lines type base_price until END and print the bill total with 2 decimals.

Input

Lines, then END.

Output

The total.

Sample 1

Input
food 100
book 200
electronics 1000
END
Output
1455.00

Sample 2

Input
book 50
END
Output
50.00
solution.py
Output appears here
Polymorphic Bill · Python practice problem · LearnPy Hub