Functions (Edexcel GCSE Computer Science): Flashcards

📚Flashcards
Functions
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

12 cards from this deck

Show

Function definition

A special type of subprogram that returns a value to the code that called it

Keyword to create a function in Python

def

Parameters

Variables that receive values passed from the main program

Local variables

Variables created inside a function, only usable within it

Return statement purpose

Sends a result back to the main program

Calling a function

Executing a function after it's been defined

Arguments

The actual values you pass TO the function

Arguments vs parameters distinction

Arguments are sent; parameters receive inside the function

Parameter naming convention tip

Start parameter names with 'p' to avoid confusion

Local scope

Variables inside functions can't be accessed from outside

When to use functions

For repeated calculations, organization, or breaking problems

Common mistake with local variables

Trying to use them outside the function where they were created

Join 100,000+ GCSE students studying Flashcards with us.

Select your subjects, and get access to A+ resources today.