Practise building up boolean expressions with relational and logical operators.
Five values are read from the standard input, one per line, in this order:
a — an integerprice1 — an integer, the price under offer 1discount1 — a float, the discount on offer 1 in percentprice2 — an integer, the price under offer 2discount2 — a float, the discount on offer 2 in percentAssign the following boolean variables:
output1 — True if a is greater than or equal to 5output2 — True if a is divisible by 5output3 — True if a is an odd number less than 10output4 — True if a is an odd number in the range -10 to 10 (both exclusive)output5 — True if str(a) has an even number of characters and no more than 10 charactersis_offer1_cheaper — True if the price of offer 1 after its discount is strictly less than the price of offer 2 after its discountEvery variable must hold a bool, so build each one out of comparisons and the and / or / not operators rather than an if statement.
The input is read for you. Assign the answers to output1, output2, output3, output4, output5, is_offer1_cheaper.
You do not need to print anything — the values you assign to those names are what gets checked, in that order.
Input
5
50
4
60
8
Output
True
True
True
True
False
True