Answer:
Hi there Tonyhh! Please find the implementation below.
Explanation:
You can save the below code in a file called "price_discount.py". The code is implemented in python 2.0+. To make it work in Python 3.0+, simply update the code to use "input" rather than "raw_input".
price_discount.py
def calculate_discount(price, quantity):
total = 0.95 * price * quantity;
return total;
price = raw_input("Enter a price: ");
try:
price = int(price);
while price <= 0:
print("Input a valid number: ")
price = raw_input("Enter a price: ");
quantity = raw_input("Enter a quantity: ");
try:
quantity = int(quantity);
if quantity >= 10:
print(calculate_discount(price, quantity));
except ValueError:
print("Invalid quantity!")
except ValueError:
print("Invalid input!");
price = -1;
False Line spacing options
Single This option accommodates the largest font in that line, plus a small amount of extra space. The amount of extra space varies depending on the font that is used.
1.5 lines This option is one-and-one-half times that of single line spacing.
Double This option is twice that of single line spacing.
At least This option sets the minimum line spacing that is needed to fit the largest font or graphic on the line.
Exactly This option sets fixed line spacing, expressed in points. For example, if the text is in a 10-point font, you can specify 12 points as the line spacing.
Multiple This option sets line spacing that can be expressed in numbers greater than 1. For example, setting line spacing to 1.15 will increase the space by 15 percent, and setting line spacing to 3 increases the space by 300 percent (triple spacing).
hope this help
Answer:
It focuses on one task and has no self awareness