logo

Learning objective

Returning a value/values from a subroutine: Be able to use subroutines that return values to the calling routine. 44

Read the explanation, check the common trap, then practise with flashcards and questions.

At a glance

0

Flashcards

0

Questions

Topic

Programming

Subtopic

Returning a value/values from a subroutine

Aqa A Level Computer ScienceFundamentals of programming

Study support

Understand this objective

Quick explanation

Returning a value/values from a subroutine: Be able to use subroutines that return values to the calling routine. 44

  • This point belongs to Programming, especially Returning a value/values from a subroutine.
  • You need to be able to returning a value/values from a subroutine: Be able to use subroutines that return values to the calling routine. 44.
  • Use the linked flashcards and practice questions to check recall, then practise applying the idea in an exam-style answer.

Why it matters

This objective helps connect Returning a value/values from a subroutine to exam-style questions, flashcards, and revision notes for Programming.

Quick student answer

In Python 3, what value is stored in result after this code runs? def double(number): return number * 2 result = double(6)

Direct answer

12

Key terms

  • Calling routine: The part of a program that invokes a subroutine and can receive and use the value returned by it.
  • Return value: The value sent from a subroutine back to the calling routine by a return statement.

Common trap

Displaying instead of returning: Use return to send the value back to the calling routine, then assign or use the result there.

Related questions

Try this as a practice card

4 linked

Question 1 of 4

Choose an answer, get feedback, then move sideways through the set.

0 of 4 attempted

Flashcard prompts

Flip through the key recall cards

4 cards

Flashcard 1 of 4

Press Space to flip, arrows to move

Revision tools

Choose how to practise

Back to topic hub
Flashcards0 linked cards
No objective-specific flashcards are cached for this page. Use the topic hub to revise the surrounding flashcards without triggering a frozen-subject DB fallback.Open topic hub
Practice Questions0 linked questions
No objective-specific practice questions are cached for this page. Use the topic question bank to practise nearby curriculum questions without weakening the egress guard.Open topic questions

Related learning objectives