PROBLEM 12
Easy

Price After Discount

Programming Basics · Python

</>
STATUS Not solved

TASK

Problem

#12

Given `price` and percentage `discount`, print the price after discount.

EXAMPLE

Example

Input
1000 15
Output
850.0

LIMITS

Constraints

0 ≤ discount ≤ 100
📖
LEARN Theory for this problem
+

`input()` reads data entered by the user. The result of `input()` is initially a string. `split()` separates one input line into individual values using spaces. `map()` applies the specified conversion to each input value. The `-` operator subtracts one number from another. The `*` operator multiplies numbers. The `/` operator performs regular division and may return a decimal number. `print()` displays the program result. Print only what the problem statement requires.

**Connection to this task.** The `/` operator performs true division and returns a floating-point value in Python. This matters for averages, percentages, and formulas whose result may be fractional. The expression `price * (100 - discount) / 100` shows how this idea is applied to the task data.

💡
NEED HELP? Hints
+

['After the discount, `100 - discount` percent of the price remains.']

ANSWER Solution
+
price, discount = map(float, input().split())
result = price * (100 - discount) / 100
print(result)