Problem 159817 · easy · Phase 01 Prerequisites & Setup

Airline Luggage Check

conditionals · boolean logic · arithmetic

An airline checks each suitcase by weight (kg) and by the sum of its three dimensions (cm). Write luggage_check(weight, length, width, height) that returns:

  • "rejected" if the weight is over 32 or the dimension sum is over 203
  • "fee" if it is not rejected but the weight is over 23 or the dimension sum is over 158
  • "ok" otherwise

Examples

Input:  weight = 20, length = 55, width = 40, height = 20
Output: "ok"

Input:  weight = 28, length = 60, width = 40, height = 25
Output: "fee"

Input:  weight = 35, length = 50, width = 40, height = 20
Output: "rejected"

Constraints

  • 0 <= weight <= 100
  • 0 <= length, width, height <= 200

Goals

  • Combine two independent limits with or
  • Check the strictest rule first
Starting Python…