Skip to content
MathsGenie logo
Open app

Course home

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

Data types and structures

EasyMedium
12345678910111213141516171819
Question 2

A program calculates the delivery cost of a package based on its weight.

base_rate = 5.50

def calculate_delivery(weight):
    package_fee = 1.20
    if weight > 10:
        total = (weight * base_rate) + package_fee
    else:
        total = (weight * base_rate)
    return total

Study the code above.

Identify the name of one local variable.

[1]

Data types and structures Questions

  1. IGCSE
  2. /Computer Science
  3. /Data types and structures