146. Python Program to Break a Long Line of Code (PEP 8)
MediumSpacing
Overview
Two lines in this program are wider than PEP 8 allows. Break them the clean way: inside brackets.
Problem Statement
The starter code reads three prices and prints the order total, with a delivery fee of 40 added. For example, for 100, 250 and 75:
Your order total, including the delivery fee, is: 465
Rewrite it in PEP 8 style:
- every line at most 79 characters: break the long lines inside brackets, and indent the extra lines,
- one space around
=and+, and one after every comma, - but no spaces around the
=of the default valuedelivery_fee=40, - two blank lines after the function.
Keep the printed text exactly the same: don't break the string itself. Use input() with no prompt text: the tests type the input for you, and a prompt would end up in your output.
The tests check only the output, and the starter code already prints the right thing. So count your line lengths yourself (most code editors show the column number at the bottom).
Input
One value per line, in this order. Example:
100
250
75
Output
The output for that example:
Your order total, including the delivery fee, is: 465
The tests try 3 different inputs.