Business and technology qualifications, Levels 3-6, in Brussels. Explore qualifications
Portal login
Diploma in Higher Education Studies

Functions: reusable code

HES 211 · Introduction to Programming with Python — Week 9 of 16

CourseHES 211
Week9 of 16
SemesterII
TutorOnline in the course chat

This week’s topics

Functions: reusable code

  1. Defining and calling a function
  2. Parameters and return values

What you will be able to do

  • 3.1 Define and call functions to modularise code.

Activity

Rewrite an earlier program using functions.

Study materials

Further resources

  • Introduction to Python Programming, ch. 6: Functions · PDF · OpenStax Introduction to Python Programming (2024), ch. 6: defining and calling functions, parameters and return values, pp. 137–163 · for registered students
  • Think Python, ch. 3: Functions · PDF · Downey, Think Python 2e (Green Tea Press), ch. 3: defining functions, parameters and arguments, pp. 17–28 · for registered students
  • Think Python, ch. 6: Fruitful functions · PDF · Downey, Think Python 2e (Green Tea Press), ch. 6: return values, pp. 51–62 · for registered students
  • Understanding students' failure to use functions as a tool for abstraction (CS1 Python) · Open-access article · Haglund et al. (2021), Informatics in Education. Why Python beginners avoid writing their own functions, with examples. · for registered students
Materials marked “for registered students” open in the student portal, which is set up as soon as you receive final acceptance.
Course chat

Admitted students ask questions on this week’s page in the student portal: an AI assistant trained on the course answers first, and during the course’s timetabled classes Connect to your tutor brings your tutor into the chat, who may start a call if needed.

Open this week in the portal
Course plan
  • Week 1: What is programming? High- and low-level languages
  • Week 2: Your first Python program
  • Week 3: Variables, data types and constants
  • Week 4: Input, output and calculations
  • Week 5: Making decisions: if, elif and else
  • Week 6: Repeating code: for loops
  • Week 7: Repeating code: while loops
  • Midterm: Midterm evaluation
  • Week 9: Functions: reusable code
  • Week 10: Lists
  • Week 11: Looping through data; tuples and dictionaries
  • Week 12: Finding and fixing errors
  • Week 13: Tracing and testing a program
  • Week 14: Mini project: a small program step by step
  • Week 15: Review and coursework completion
  • Final: Final assessment and submission
Back to the course
Scroll