Skip to content

Course home

Subprograms

Subprograms

EasyMedium
123456789101112131415161718192021222324252627282930
Question 4

Elena has written a Python program to manage a smart heating system.

Read the following code:

def adjust_temperature(target_temp):
    current_temp = read_sensor()
    if current_temp < target_temp:
         turn_heater_on()
    else:
         turn_heater_off()

# Main program
user_setting = 21
adjust_temperature(user_setting)

Identify the name of the variable passed from the main program to the subprogram.

[1]
Markscheme

Subprograms Questions

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

33 exam-style questions on Edexcel IGCSE Computer Science Subprograms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank