Skip to content
MathsGenie logo
Open app

Course home

  1. IGCSE
  2. Computer Science Edexcel
  3. Question bank

Constructs

EasyMedium
1234
Question 1

Amira is writing a program to classify parcels for a delivery courier based on their weight (in kg) and length (in cm).

She has designed a set of rules to categorize the parcels:

ConditionOutput text
Weight is 25 kg or more and Length is 120 cm or moreHeavy and oversized package
Weight is 25 kg or more or Length is 120 cm or moreSpecial handling required
Weight is less than 5 kg and Length is less than 50 cmSmall parcel discount
Any other combinationStandard delivery

Complete the four missing conditions or structures in the Python code below to implement these rules correctly.

weight = float(input("Enter parcel weight in kg: "))
length = float(input("Enter parcel length in cm: "))

if _________________________________________:  # Blank 1
    print("Heavy and oversized package")
elif ________________________________________:  # Blank 2
    print("Special handling required")
elif ________________________________________:  # Blank 3
    print("Small parcel discount")
_________________:                              # Blank 4
    print("Standard delivery")
[6]

Constructs Questions

  1. IGCSE
  2. /Computer Science
  3. /Constructs