PROBLEM 75
Medium

Delivery Availability

Programming Basics · Python

</>
STATUS Not solved

TASK

Problem

#75

Given distance in km and weight in kg. Delivery is available if distance≤30 and weight≤20.

EXAMPLE

Example

Input
12 5
Output
AVAILABLE

LIMITS

Constraints

distance ≥ 0; weight ≥ 0
📖
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. Comparison operators `==`, `!=`, `<`, `>`, `<=`, `>=` compare values and produce `True` or `False`. `and` requires all combined conditions to be true. `if` checks a condition and runs its block when the condition is true. `else` runs when the corresponding `if` condition is false. `print()` displays the program result. Print only what the problem statement requires.

**Connection to this task.** An `if` statement chooses a program branch from a Boolean condition. Comparisons produce `True` or `False`, and `elif` lets you test several mutually exclusive cases in order. The expression `'AVAILABLE'` shows how this idea is applied to the task data.

💡
NEED HELP? Hints
+

['Both limits must hold.']

ANSWER Solution
+
d, w = map(float, input().split())
if d <= 30 and w <= 20:
    print('AVAILABLE')
else:
    print('UNAVAILABLE')