Computer Science › Section G · Programming languages › Topic G.3

Procedural units: functions and parameters

Large programs stay manageable only because they are built from small, named pieces that can be written, tested and reused on their own. Functions are those pieces, and parameters are what make one function useful for many different inputs.

In this topic

  • Why break programs into functions
  • Calling and returning
  • Local variables and scope
  • Worked example: tracing scope
  • Formal and actual parameters
  • Passing by value and by reference
  • Python's model: passing object references
  • Worked example: rebinding versus mutating
  • Functions that return values
  • Event-driven functions
  • Common mistakes to avoid
  • Key takeaways

This topic is part of Wuanberri Pro. Checking your access…

← Previous topicNext topic →