Please enable JavaScript to use CodeHS

AP Computer Science Principles in Python (2025)

Functions and Parameters

Students learn how to write reusable code with functions and parameters.

Lessons

5.1 Functions and Parameters 1

  • Functions and Parameters 1
  • Functions and Parameters Quiz 1
  • Double Number
  • Square
  • Triple

5.2 Functions and Parameters 2

  • Functions and Parameters 2
  • Functions and Parameters Quiz 2
  • Sum Function
  • Area of Triangle
  • Height in Meters

5.3 Functions and Parameters 3

  • Functions and Parameters 3
  • Functions and Parameters Quiz 3
  • Draw Circles
  • Horizontal Lines
  • Graphics Stop Light
  • +2 more

5.4 Functions and Return Values 1

  • Functions and Return Values 1
  • Functions and Return Values 1 Quiz
  • Double Number
  • Square with Return Values
  • Quadruple with Return Values

5.5 Functions and Return Values 2

  • Functions and Return Values 2
  • Functions and Return Values Quiz 2
  • Return Values
  • Is It Even?
  • Minimum of Two Numbers

5.6 Local Variables and Scope

  • Local Variables and Scope
  • Local Variables and Scope Quiz
  • Return Values
  • Local Variables

5.7 Exceptions

  • Exceptions
  • Exceptions Quiz
  • Enter a Number
  • Enter Name and Age
  • Temperature Converter
  • +1 more

5.8 Python vs Karel

  • Python vs Karel
  • Making Karel's World
  • Making Karel Turn Left
  • Making Karel Turn Right
  • Making Karel Move
  • +3 more

5.9 Basic Python and Graphics Challenges

  • Ghosts
  • Guessing Game
  • Draw Something
  • Python Challenges Badge

5.10 Functions and Parameters Quiz

  • Functions and Parameters Quiz